)]}'
{"cliff/formatters/table.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"29148e1c87b033c1820ecd030dc082119c615835","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            print_empty\u003dFalse,"},{"line_number":28,"context_line":"        )"},{"line_number":29,"context_line":"        x.padding_width \u003d 1"},{"line_number":30,"context_line":"        if parsed_args.max_width:"},{"line_number":31,"context_line":"            x.max_width \u003d parsed_args.max_width"},{"line_number":32,"context_line":"        # Figure out the types of the columns in the"},{"line_number":33,"context_line":"        # first row and set the alignment of the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BOSA%3D","line":30,"updated":"2014-01-28 22:47:30.000000000","message":"parsed_args is an argparse namespace object created when the command line arguments are parsed. The expression parsed_args.max_width should produce an AttributeError unless an option is defined by the formatter in add_argument_group().","commit_id":"125eddc9420e8bf77730faae49fbf0bbcd36d6de"},{"author":{"_account_id":2468,"name":"unicell","email":"unicell@gmail.com","username":"unicell"},"change_message_id":"1ae1612736488f5c0c746564a0b9b6138edf5114","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            print_empty\u003dFalse,"},{"line_number":28,"context_line":"        )"},{"line_number":29,"context_line":"        x.padding_width \u003d 1"},{"line_number":30,"context_line":"        if parsed_args.max_width:"},{"line_number":31,"context_line":"            x.max_width \u003d parsed_args.max_width"},{"line_number":32,"context_line":"        # Figure out the types of the columns in the"},{"line_number":33,"context_line":"        # first row and set the alignment of the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BM6E%3D","line":30,"in_reply_to":"AAAAUH%2F%2BOSA%3D","updated":"2014-01-29 04:39:56.000000000","message":"When I drafting this patch, the intended use case in my mind was projects using cliff library, say python-openstackclient, could register max_width argument in their get_parser() callback.\n\nSample code:\n\n 21 from cliff import show\n 22\n 23\n 24 class CreateToken(show.ShowOne):\n 25     \"\"\"Create token command\"\"\"\n 26\n 27     log \u003d logging.getLogger(__name__ + \u0027.CreateToken\u0027)\n 28\n 29     def get_parser(self, prog_name):\n 30         parser \u003d super(CreateToken, self).get_parser(prog_name)\n 31         parser.add_argument(\n 32             \u0027--max_width\u0027,\n 33             metavar\u003d\u0027\u003cinteger\u003e\u0027,\n 34             default\u003d0,\n 35             help\u003d\u0027Maximum display width, 0 to disable\u0027)\n 36         return parser\n\nOnce registered, cliff could use this argument to finetune prettytable\u0027s display width.\n\nBut thanks for reminding me adding check for existence of such argument in cliff. I\u0027ll update my next patchset to address it.","commit_id":"125eddc9420e8bf77730faae49fbf0bbcd36d6de"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"230ab3c1f0458d89e9758546007bcf3a1475b682","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    except NameError:"},{"line_number":19,"context_line":"        pass"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def add_argument_group(self, parser):"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    def emit_list(self, column_names, data, stdout, parsed_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2FBHE%3D","line":21,"updated":"2014-02-17 16:21:26.000000000","message":"You can use this method to add a new argument group specifically for the table formatter, and include the max_width as an option here. Then it will always be available in emit_list() or emit_one(), and applications won\u0027t have to define it themselves.","commit_id":"a16852061ba664ec10f993a085cd71f5b18c3432"},{"author":{"_account_id":2468,"name":"unicell","email":"unicell@gmail.com","username":"unicell"},"change_message_id":"5bf70afff32b916cfa9f7990d3eb91f688d5d2af","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    except NameError:"},{"line_number":19,"context_line":"        pass"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def add_argument_group(self, parser):"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    def emit_list(self, column_names, data, stdout, parsed_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2B8s4%3D","line":21,"in_reply_to":"AAAAUX%2F%2FBHE%3D","updated":"2014-02-18 02:17:05.000000000","message":"Done","commit_id":"a16852061ba664ec10f993a085cd71f5b18c3432"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"a51f8edee91412d5e968240adca298df083723e0","unresolved":false,"context_lines":[{"line_number":24,"context_line":"            \u0027--max-width\u0027,"},{"line_number":25,"context_line":"            metavar\u003d\u0027\u003cinteger\u003e\u0027,"},{"line_number":26,"context_line":"            default\u003d0,"},{"line_number":27,"context_line":"            help\u003d\u0027Maximum display width, 0 to disable\u0027,"},{"line_number":28,"context_line":"        )"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def emit_list(self, column_names, data, stdout, parsed_args):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BwjI%3D","line":27,"updated":"2014-03-24 15:19:32.000000000","message":"Add:\n\n  type\u003dint,\n\n(see note below for related changes)","commit_id":"03b196440eac6f283fb1079a6366d4b6bf8f65c8"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"a51f8edee91412d5e968240adca298df083723e0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            print_empty\u003dFalse,"},{"line_number":34,"context_line":"        )"},{"line_number":35,"context_line":"        x.padding_width \u003d 1"},{"line_number":36,"context_line":"        if int(parsed_args.max_width) \u003e 0:"},{"line_number":37,"context_line":"            x.max_width \u003d int(parsed_args.max_width)"},{"line_number":38,"context_line":"        # Figure out the types of the columns in the"},{"line_number":39,"context_line":"        # first row and set the alignment of the"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bwjg%3D","line":36,"updated":"2014-03-24 15:19:32.000000000","message":"If you set type when defining the argument, you don\u0027t have to convert it here and the argument parser will throw an error if they pass a bad value.","commit_id":"03b196440eac6f283fb1079a6366d4b6bf8f65c8"}]}
