)]}'
{"novaclient/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"98330dc73511aba6e46e5a7143cadd3cf50ff130","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    print pt.get_string(sortby\u003dsortby)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def print_dict(d, dict_property\u003d\"Property\", row_len\u003d100):"},{"line_number":169,"context_line":"    pt \u003d prettytable.PrettyTable([dict_property, \u0027Value\u0027], caching\u003dFalse)"},{"line_number":170,"context_line":"    pt.align \u003d \u0027l\u0027"},{"line_number":171,"context_line":"    for k, v in d.iteritems():"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FhLE%3D","line":168,"updated":"2013-01-17 16:48:23.000000000","message":"I use 80-column windows, and I expect that\u0027s fairly standard, since our hacking standards talk about wrapping commit messages at 72 characters and PEP8 talks about a line limit on code of 79 characters.  Might I suggest reducing this value to something between 70 and 80 characters in length?","commit_id":"34509cd2f7c3f8be4e526cfb63798a05de755def"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"55595eb946af6f521f70758c2e579ec2380644bd","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    print pt.get_string(sortby\u003dsortby)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def print_dict(d, dict_property\u003d\"Property\", row_len\u003d100):"},{"line_number":169,"context_line":"    pt \u003d prettytable.PrettyTable([dict_property, \u0027Value\u0027], caching\u003dFalse)"},{"line_number":170,"context_line":"    pt.align \u003d \u0027l\u0027"},{"line_number":171,"context_line":"    for k, v in d.iteritems():"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FgYY%3D","line":168,"in_reply_to":"AAAAM3%2F%2FhLE%3D","updated":"2013-01-18 02:35:05.000000000","message":"Sure. I think PEP8 limit is 80 characters based on running the PEP8 check with the unit tests.","commit_id":"34509cd2f7c3f8be4e526cfb63798a05de755def"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"81a7ff75ae4e68a78fd851989da4ec87ec63f5dc","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    print pt.get_string(sortby\u003dsortby)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def print_dict(d, dict_property\u003d\"Property\", row_len\u003d80):"},{"line_number":169,"context_line":"    pt \u003d prettytable.PrettyTable([dict_property, \u0027Value\u0027], caching\u003dFalse)"},{"line_number":170,"context_line":"    pt.align \u003d \u0027l\u0027"},{"line_number":171,"context_line":"    for k, v in d.iteritems():"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2FfqM%3D","line":168,"updated":"2013-01-18 16:12:57.000000000","message":"Actually, I looked it up; PEP-0008 says specifically, \"Limit all lines to a maximum of 79 characters.\"  (http://www.python.org/dev/peps/pep-0008/#maximum-line-length).","commit_id":"a73f446b927dca94cfac1f2fc724f96fb2017cb6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b24b24d07a128775c7700b7a5ab95796deed57df","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    print pt.get_string(sortby\u003dsortby)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def print_dict(d, dict_property\u003d\"Property\", row_len\u003d80):"},{"line_number":169,"context_line":"    pt \u003d prettytable.PrettyTable([dict_property, \u0027Value\u0027], caching\u003dFalse)"},{"line_number":170,"context_line":"    pt.align \u003d \u0027l\u0027"},{"line_number":171,"context_line":"    for k, v in d.iteritems():"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Fe78%3D","line":168,"in_reply_to":"AAAAM3%2F%2FfqM%3D","updated":"2013-01-19 02:28:50.000000000","message":"Okay. I assumed it was 80 because I never see the PEP8 check fail on me for lines 80 characters long.","commit_id":"a73f446b927dca94cfac1f2fc724f96fb2017cb6"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"81a7ff75ae4e68a78fd851989da4ec87ec63f5dc","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        # if value is long, add in multiple rows e.g. fault with stacktrace"},{"line_number":176,"context_line":"        if v and isinstance(v, basestring) and len(v) \u003e row_len:"},{"line_number":177,"context_line":"            # try splitting on newlines first"},{"line_number":178,"context_line":"            lines \u003d v.strip().split(r\u0027\\n\u0027)"},{"line_number":179,"context_line":"            for i in range(len(lines)):"},{"line_number":180,"context_line":"                line \u003d lines[i]"},{"line_number":181,"context_line":"                # wrap if line still too long"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2FfqI%3D","line":178,"updated":"2013-01-18 16:12:57.000000000","message":"Yeah, I figured as much…","commit_id":"a73f446b927dca94cfac1f2fc724f96fb2017cb6"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"81a7ff75ae4e68a78fd851989da4ec87ec63f5dc","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                    sublines \u003d textwrap.wrap(line, row_len)"},{"line_number":184,"context_line":"                    for j in range(len(sublines)):"},{"line_number":185,"context_line":"                        subline \u003d sublines[j]"},{"line_number":186,"context_line":"                        pt.add_row([k if i \u003d\u003d 0 and j \u003d\u003d 0 else \u0027\u0027, subline])"},{"line_number":187,"context_line":"                else:"},{"line_number":188,"context_line":"                    pt.add_row([k if i \u003d\u003d 0 else \u0027\u0027, lines[i]])"},{"line_number":189,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Ffp4%3D","line":186,"updated":"2013-01-18 16:12:57.000000000","message":"Question: If I understand this correctly, the table ends up looking something like:\n\n    +-------+----------------------------------------------------+\n    | fault | first line of fault followed by a bunch of spaces  |\n    |       | second line of fault followed by a bunch of spaces |\n    +-------+----------------------------------------------------+\n\nCorrect?  But the word wrapping we\u0027re applying is on \"first line of fault followed by a bunch of spaces\", without taking into account the size of the first table column.  That means that, on an 80 character wide window, this is still going to wrap horribly.\n\nI have two different suggestions on handling this.  The first is the simplest: only split on the r\u0027\\n\u0027.  Yes, it will wrap, but it will still be easier to follow the trace with the lines broken that way than without any splitting.  The second suggestion would be to limit the lines to something like 50 or 60 characters, rather than 80; that should accommodate the first table column while fitting the entire table into the screen width.\n\nI personally recommend the first approach, primarily because the long lines in stack traces tend to be long because of path names, which it is convenient to be able to cut-and-paste, and because the other lines that could be wrapped are lines of code, and wrapping those can make it more difficult to follow the trace.","commit_id":"a73f446b927dca94cfac1f2fc724f96fb2017cb6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b24b24d07a128775c7700b7a5ab95796deed57df","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                    sublines \u003d textwrap.wrap(line, row_len)"},{"line_number":184,"context_line":"                    for j in range(len(sublines)):"},{"line_number":185,"context_line":"                        subline \u003d sublines[j]"},{"line_number":186,"context_line":"                        pt.add_row([k if i \u003d\u003d 0 and j \u003d\u003d 0 else \u0027\u0027, subline])"},{"line_number":187,"context_line":"                else:"},{"line_number":188,"context_line":"                    pt.add_row([k if i \u003d\u003d 0 else \u0027\u0027, lines[i]])"},{"line_number":189,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Fe70%3D","line":186,"in_reply_to":"AAAAM3%2F%2Ffp4%3D","updated":"2013-01-19 02:28:50.000000000","message":"Yeah, you\u0027re right.\n\nI was trying to handle the case of the fault \"message\" being long but I see the point that it\u0027s not worth making the stack trace harder to work with.","commit_id":"a73f446b927dca94cfac1f2fc724f96fb2017cb6"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ba73581bd5c97e344a96ba5112c3634456bc66d3","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            # split on newlines"},{"line_number":177,"context_line":"            lines \u003d v.strip().split(r\u0027\\n\u0027)"},{"line_number":178,"context_line":"            for i in range(len(lines)):"},{"line_number":179,"context_line":"                pt.add_row([k if i \u003d\u003d 0 else \u0027\u0027, lines[i]])"},{"line_number":180,"context_line":"        else:"},{"line_number":181,"context_line":"            pt.add_row([k, v])"},{"line_number":182,"context_line":"    print pt.get_string()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2Fduk%3D","line":179,"updated":"2013-01-21 16:15:30.000000000","message":"Looks better, but I\u0027d go further:\n\n1. Eliminate column entirely, since you\u0027re no longer doing word wrapping\n\n2. Change the conditional to:\n\n    if v and isinstance(v, basestring) and r\u0027\\n\u0027 in v:\n\n3. Change the loop to:\n\n    col1 \u003d k\n    for line in lines:\n        pt.add_row([col1, line])\n        col1 \u003d \u0027\u0027\n\nThat will eliminate the loop index variable, which you only need for the key that goes in the first column.\n\n(As an alternative, you could consider moving the key to the middle row, but that probably complicates the logic some.)","commit_id":"a525deed4a69115d4fb97f0d507ee1415cef0d27"}]}
