)]}'
{"novaclient/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":255,"context_line":""},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"def _format_field_name(attr):"},{"line_number":258,"context_line":"    \"\"\"Format an object attribute in a human-friendly way."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    # Split at \u0027:\u0027 and leave the extension name as-is."},{"line_number":261,"context_line":"    parts \u003d attr.split(\u0027:\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDy0%3D","line":258,"updated":"2013-02-08 16:23:26.000000000","message":"Nit: This is a one-line docstring; please put the closing triple-quote at the end of the line.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":5733,"name":"Kieran Spear","email":"kispear@gmail.com","username":"kspear"},"change_message_id":"2b8956d90a7369631954e2e60b5a1dae82d05534","unresolved":false,"context_lines":[{"line_number":255,"context_line":""},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"def _format_field_name(attr):"},{"line_number":258,"context_line":"    \"\"\"Format an object attribute in a human-friendly way."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    # Split at \u0027:\u0027 and leave the extension name as-is."},{"line_number":261,"context_line":"    parts \u003d attr.split(\u0027:\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FB%2Fw%3D","line":258,"in_reply_to":"AAAAM3%2F%2FDy0%3D","updated":"2013-02-11 00:20:09.000000000","message":"Done","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    parts \u003d attr.split(\u0027:\u0027)"},{"line_number":262,"context_line":"    name \u003d parts.pop().replace(\u0027_\u0027, \u0027 \u0027)"},{"line_number":263,"context_line":"    # Don\u0027t title() on mixed case"},{"line_number":264,"context_line":"    if name.upper() \u003d\u003d name or name.lower() \u003d\u003d name:"},{"line_number":265,"context_line":"        name \u003d name.title()"},{"line_number":266,"context_line":"    return \u0027: \u0027.join(parts + [name])"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDyk%3D","line":264,"updated":"2013-02-08 16:23:26.000000000","message":"You can use .islower() and .isupper() for this, instead of converting and comparing.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":5733,"name":"Kieran Spear","email":"kispear@gmail.com","username":"kspear"},"change_message_id":"2b8956d90a7369631954e2e60b5a1dae82d05534","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    parts \u003d attr.split(\u0027:\u0027)"},{"line_number":262,"context_line":"    name \u003d parts.pop().replace(\u0027_\u0027, \u0027 \u0027)"},{"line_number":263,"context_line":"    # Don\u0027t title() on mixed case"},{"line_number":264,"context_line":"    if name.upper() \u003d\u003d name or name.lower() \u003d\u003d name:"},{"line_number":265,"context_line":"        name \u003d name.title()"},{"line_number":266,"context_line":"    return \u0027: \u0027.join(parts + [name])"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FB%2Fo%3D","line":264,"in_reply_to":"AAAAM3%2F%2FDyk%3D","updated":"2013-02-11 00:20:09.000000000","message":"Ah, good point. Done.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    # Don\u0027t title() on mixed case"},{"line_number":264,"context_line":"    if name.upper() \u003d\u003d name or name.lower() \u003d\u003d name:"},{"line_number":265,"context_line":"        name \u003d name.title()"},{"line_number":266,"context_line":"    return \u0027: \u0027.join(parts + [name])"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"def _make_field_formatter(attr, filters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDyU%3D","line":266,"updated":"2013-02-08 16:23:26.000000000","message":"Instead of popping, consider just doing the transformation in place, i.e.:\n\n    parts[-1] \u003d parts[-1].replace(\u0027_\u0027, \u0027 \u0027)\n    if parts[-1].isupper() or parts[-1].islower():\n        parts[-1] \u003d parts[-1].title()\n    return \u0027: \u0027.join(parts)\n\nAlso, I\u0027m not certain I understand why you have these parts re-joined with \u0027: \u0027; in the case of a name with multiple colons in it, i.e., \"foo:bar:baz\", you would end up with the string \"foo: bar: Baz\".  You might want to consider using rsplit and a limit of 1, i.e.:\n\n    parts \u003d attr.rsplit(\u0027:\u0027, 1)\n\nWith that alteration, \"foo:bar:baz\" now formats as \"foo:bar: Baz\"","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    will be passed the value of the attribute and should return the string to"},{"line_number":276,"context_line":"    display."},{"line_number":277,"context_line":"    \"\"\""},{"line_number":278,"context_line":"    _filter \u003d None"},{"line_number":279,"context_line":"    if filters:"},{"line_number":280,"context_line":"        _filter \u003d filters.get(attr)"},{"line_number":281,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDxo%3D","line":278,"updated":"2013-02-08 16:23:26.000000000","message":"femtonit: I generally see a leading underscore used only in the case of function parameters that are not actually used in the body of the function.  I might suggest using \"filter_\" (to differentiate from the Python built-in), \"filt\" (the abbreviation I would tend to use), or just \"filter\" (since you\u0027re not using the Python built-in within the scope of this function anyway).  Of the options, I prefer \"filt\", with \"filter_\" a close second.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":5733,"name":"Kieran Spear","email":"kispear@gmail.com","username":"kspear"},"change_message_id":"2b8956d90a7369631954e2e60b5a1dae82d05534","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    will be passed the value of the attribute and should return the string to"},{"line_number":276,"context_line":"    display."},{"line_number":277,"context_line":"    \"\"\""},{"line_number":278,"context_line":"    _filter \u003d None"},{"line_number":279,"context_line":"    if filters:"},{"line_number":280,"context_line":"        _filter \u003d filters.get(attr)"},{"line_number":281,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FB%2Bg%3D","line":278,"in_reply_to":"AAAAM3%2F%2FDxo%3D","updated":"2013-02-11 00:20:09.000000000","message":"Yep. I think I flip flopped between all three options while writing the patch. :)\nI try to avoid abbreviation unless it\u0027s very conventional, so let\u0027s go with filter_.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"}],"novaclient/v1_1/shell.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":893,"context_line":"    default\u003dNone,"},{"line_number":894,"context_line":"    metavar\u003d\u0027\u003cfields\u003e\u0027,"},{"line_number":895,"context_line":"    help\u003d\u0027Comma-separated list of fields to display. \u0027"},{"line_number":896,"context_line":"         \u0027Use the show command to see which fields are available.\u0027)"},{"line_number":897,"context_line":"def do_list(cs, args):"},{"line_number":898,"context_line":"    \"\"\"List active servers.\"\"\""},{"line_number":899,"context_line":"    imageid \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDxg%3D","line":896,"updated":"2013-02-08 16:23:26.000000000","message":"You might want to consider \u0027action\u003d\"append\"\u0027; this will allow you to specify multiple fields like so:\n\n    nova list --fields one --fields two …\n\nThen args.fields would be [\"one\", \"two\"].  (Of course, in that case, I would also recommend using \"--field\" instead of \"--fields\".)  This would save you from having to do a split(\u0027,\u0027).  Just a suggestion…","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":5733,"name":"Kieran Spear","email":"kispear@gmail.com","username":"kspear"},"change_message_id":"2b8956d90a7369631954e2e60b5a1dae82d05534","unresolved":false,"context_lines":[{"line_number":893,"context_line":"    default\u003dNone,"},{"line_number":894,"context_line":"    metavar\u003d\u0027\u003cfields\u003e\u0027,"},{"line_number":895,"context_line":"    help\u003d\u0027Comma-separated list of fields to display. \u0027"},{"line_number":896,"context_line":"         \u0027Use the show command to see which fields are available.\u0027)"},{"line_number":897,"context_line":"def do_list(cs, args):"},{"line_number":898,"context_line":"    \"\"\"List active servers.\"\"\""},{"line_number":899,"context_line":"    imageid \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FB%2BY%3D","line":896,"in_reply_to":"AAAAM3%2F%2FDxg%3D","updated":"2013-02-11 00:20:09.000000000","message":"It does make the implementation cleaner. But as a user I really prefer the convenience of a comma-separated list.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0812a58cb1fb11266c4323d7639b4a3e7e8d0fbb","unresolved":false,"context_lines":[{"line_number":922,"context_line":"    field_titles \u003d []"},{"line_number":923,"context_line":"    if args.fields:"},{"line_number":924,"context_line":"        fields \u003d filter(bool, args.fields.split(\u0027,\u0027))"},{"line_number":925,"context_line":"        for field in fields:"},{"line_number":926,"context_line":"            field_title, formatter \u003d utils._make_field_formatter(field,"},{"line_number":927,"context_line":"                                                                 filters)"},{"line_number":928,"context_line":"            field_titles.append(field_title)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDxU%3D","line":925,"updated":"2013-02-08 16:23:26.000000000","message":"I wouldn\u0027t use filter here, to be honest.  I\u0027d suggest something more like:\n\n    for field in args.fields.split(\u0027,\u0027):\n\nOr, if you take my suggestion of \u0027action\u003d\"append\"\u0027 above, you can do:\n\n    for field in args.fields:\n\nAlso note that, again with \u0027action\u003d\"append\"\u0027, you can drop the \"if args.fields\" line, as args.fields would end up being an empty list.  (That is, if you remove the \"default\u003dNone\" from the option declaration…)","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"},{"author":{"_account_id":5733,"name":"Kieran Spear","email":"kispear@gmail.com","username":"kspear"},"change_message_id":"2b8956d90a7369631954e2e60b5a1dae82d05534","unresolved":false,"context_lines":[{"line_number":922,"context_line":"    field_titles \u003d []"},{"line_number":923,"context_line":"    if args.fields:"},{"line_number":924,"context_line":"        fields \u003d filter(bool, args.fields.split(\u0027,\u0027))"},{"line_number":925,"context_line":"        for field in fields:"},{"line_number":926,"context_line":"            field_title, formatter \u003d utils._make_field_formatter(field,"},{"line_number":927,"context_line":"                                                                 filters)"},{"line_number":928,"context_line":"            field_titles.append(field_title)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FB%2BU%3D","line":925,"in_reply_to":"AAAAM3%2F%2FDxU%3D","updated":"2013-02-11 00:20:09.000000000","message":"Yeah, the filter was just to remove empty strings from the array and avoid empty columns showing up in the output. Probably overkill though, so I\u0027ve removed it.","commit_id":"5063f8f2336bb7465c7cbf55dc9fa39ec6e2bfe4"}]}
