)]}'
{"glance/client.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        while chunk:"},{"line_number":352,"context_line":"            len_chunk \u003d len(chunk)"},{"line_number":353,"context_line":"            conn.send(\u0027%x\\r\\n%s\\r\\n\u0027 % (len_chunk, chunk))"},{"line_number":354,"context_line":"            transfer_info[\u0027so_far\u0027] \u003d transfer_info[\u0027so_far\u0027] + len_chunk"},{"line_number":355,"context_line":"            chunk \u003d body.read(self.CHUNKSIZE)"},{"line_number":356,"context_line":"        conn.send(\u00270\\r\\n\\r\\n\u0027)"},{"line_number":357,"context_line":"        pg.join()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9m0%3D","line":354,"updated":"2012-01-16 23:26:08.000000000","message":"Can you use the +\u003d operator here?","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"bea5115dff1ae680473c6ae8868a0c492ba6e2c8","unresolved":false,"context_lines":[{"line_number":28,"context_line":"import glance.api.v1"},{"line_number":29,"context_line":"from glance.common import animation"},{"line_number":30,"context_line":"from glance.common import client as base_client"},{"line_number":31,"context_line":"from glance.common.client import CHUNKSIZE"},{"line_number":32,"context_line":"from glance.common import exception"},{"line_number":33,"context_line":"from glance.common import utils"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAEH%2F%2F8LY%3D","line":31,"updated":"2012-02-01 21:10:25.000000000","message":"You shouldn\u0027t import objects like CHUNKSIZE.  Instead, use \"base_client.CHUNKSIZE\" everywhere you have CHUNKSIZE.","commit_id":"bfcc48976ff1548158a7184e8735515015bddebf"}],"glance/common/animation.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    In order to sampling the rate as actually as possible,"},{"line_number":36,"context_line":"    this implementation uses two FIFO buffers(times and bytes) to record"},{"line_number":37,"context_line":"    fine-grain transfer rate in a period a time."},{"line_number":38,"context_line":"    \"\"\""},{"line_number":39,"context_line":"    NUM_OF_ELEMENTS \u003d 20            # number of element in FIFO"},{"line_number":40,"context_line":"    TIME_TO_STALL \u003d 5               # if no data transfer longer this"},{"line_number":41,"context_line":"                                    # time(secs), the network will be"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9mo%3D","line":38,"updated":"2012-01-16 23:26:08.000000000","message":"This doc comment could stand a bit of a rewrite.  Maybe this:\n\n    \"\"\"\n    A class for showing:\n\n    1. progress;\n    2. rate;\n    3. ETA;\n    4. and status, e.g. active or stalled.\n\n    In order to sample the rate as closely as possible, this\n    implementation uses two FIFO buffers (times and bytes)\n    to record fine-grain transfer rate over a period of time.\n    \"\"\"","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        if percentage \u003c 100.0:"},{"line_number":105,"context_line":"            str_percent \u003d \"[%4.1f%%]\" % percentage"},{"line_number":106,"context_line":"        else:"},{"line_number":107,"context_line":"            str_percent \u003d \"[100%]\""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            height, width \u003d utils.get_terminal_size()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9mE%3D","line":107,"updated":"2012-01-16 23:26:08.000000000","message":"You probably don\u0027t need to special-case 100%.  Also, the \u00274\u0027 doesn\u0027t seem to be doing anything for you; I\u0027d either drop it entirely or set it to \u00275\u0027 (length of \u0027100.0\u0027), depending on the effect you\u0027re going for.","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            width -\u003d len(rate)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"            bar \u003d \u0027\u003d\u0027 * int((width - len(str_percent)) * fraction) \\"},{"line_number":119,"context_line":"                + str_percent"},{"line_number":120,"context_line":"            padding \u003d \u0027 \u0027 * (width - len(bar))"},{"line_number":121,"context_line":"            sys.stdout.write(bar + padding + rate + eta)"},{"line_number":122,"context_line":"            sys.stdout.flush()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9l8%3D","line":119,"updated":"2012-01-16 23:26:08.000000000","message":"I prefer avoiding backslash continuation whenever possible.  If you wrap this expression in parentheses, you won\u0027t need the backslash.","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            padding \u003d \u0027 \u0027 * (width - len(bar))"},{"line_number":121,"context_line":"            sys.stdout.write(bar + padding + rate + eta)"},{"line_number":122,"context_line":"            sys.stdout.flush()"},{"line_number":123,"context_line":"        except exception.DataInvalid:"},{"line_number":124,"context_line":"            sys.stdout.write(\"\\b\" * 7)  # use the len of [%4.1f%%]"},{"line_number":125,"context_line":"            sys.stdout.write(str_percent + \u0027 \u0027 \\"},{"line_number":126,"context_line":"                        if self.current_size \u003d\u003d self.size else str_percent)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9ls%3D","line":123,"updated":"2012-01-16 23:26:08.000000000","message":"utils.get_terminal_size() may also raise NotImplementedError; you should either catch that here (\"except (exception.DataInvalid, NotImplementedError)\"), or use NotImplementedError in place of DataInvalid across the board.","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d69cfd535ba6c46829edcc4a42f054fa09d285ed","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    * (time.time() - self.start) / self.current_size"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            eta \u003d ((self.size - self.current_size) \\"},{"line_number":150,"context_line":"                    * self.total_times) / (self.total_bytes)"},{"line_number":151,"context_line":"        eta \u003d int(eta)"},{"line_number":152,"context_line":"        hrs \u003d mins \u003d secs \u003d 0"},{"line_number":153,"context_line":"        hrs \u003d eta / 3600"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAD3%2F%2F9l4%3D","line":150,"updated":"2012-01-16 23:26:08.000000000","message":"Again, please use parentheses rather than backslash continuation here…","commit_id":"bb1ac807fc20b465dca4c291db99e96032f127f0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"bea5115dff1ae680473c6ae8868a0c492ba6e2c8","unresolved":false,"context_lines":[{"line_number":115,"context_line":"            padding \u003d \u0027 \u0027 * (width - len(bar))"},{"line_number":116,"context_line":"            sys.stdout.write(bar + padding + rate + eta)"},{"line_number":117,"context_line":"            sys.stdout.flush()"},{"line_number":118,"context_line":"        except exception.DataInvalid:"},{"line_number":119,"context_line":"            sys.stdout.write(\"\\b\" * 7)  # use the len of [%4.1f%%]"},{"line_number":120,"context_line":"            sys.stdout.write(str_percent + \u0027 \u0027"},{"line_number":121,"context_line":"                        if self.current_size \u003d\u003d self.size else str_percent)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAEH%2F%2F8LE%3D","line":118,"updated":"2012-02-01 21:10:25.000000000","message":"I still see utils.get_terminal_size() possibly raising NotImplementedError.  You either need to catch that here (\"except (exception.DataInvalid, NotImplementedError)\"), or use NotImplementedError in place of DataInvalid across the board (which would be the solution I prefer).","commit_id":"bfcc48976ff1548158a7184e8735515015bddebf"}],"glance/common/client.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"bea5115dff1ae680473c6ae8868a0c492ba6e2c8","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        \"\"\""},{"line_number":449,"context_line":"        def _iterable(body):"},{"line_number":450,"context_line":"            return isinstance(body, collections.Iterable)"},{"line_number":451,"context_line":"        "},{"line_number":452,"context_line":"        iter \u003d body if _iterable(body) else ImageBodyIterator(body)"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        for chunk in iter:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAEH%2F%2F8Lo%3D","line":451,"updated":"2012-02-01 21:10:25.000000000","message":"You\u0027ve got a PEP8 error here—trailing whitespace.","commit_id":"bfcc48976ff1548158a7184e8735515015bddebf"}]}
