)]}'
{"Authors":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":27,"context_line":"Thierry Carrez \u003cthierry@openstack.org\u003e"},{"line_number":28,"context_line":"Vishvananda Ishaya \u003cvishvananda@gmail.com\u003e"},{"line_number":29,"context_line":"Yuriy Taraday \u003cyorik.sar@gmail.com\u003e"},{"line_number":30,"context_line":"Reynolds Chin \u003cbenzwt@gmail.com\u003e"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMc%3D","line":30,"updated":"2011-09-14 16:27:18.000000000","message":"Not a blocker, but I believe we\u0027re going for alphabetical order, so this should probably be just before Soren\u0027s entry.","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"}],"bin/glance":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            import termios"},{"line_number":93,"context_line":"            import struct"},{"line_number":94,"context_line":"            import os"},{"line_number":95,"context_line":"            ncol_nrow \u003d struct.unpack(\u0027hh\u0027, \\"},{"line_number":96,"context_line":"                        fcntl.ioctl(fd, termios.TIOCGWINSZ, \u00271234\u0027))"},{"line_number":97,"context_line":"        except:"},{"line_number":98,"context_line":"            return None"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMY%3D","line":95,"updated":"2011-09-14 16:27:18.000000000","message":"You don\u0027t need a continuation here; the parentheses take care of that.","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        try:"},{"line_number":103,"context_line":"            fd \u003d os.open(os.ctermid(), os.O_RDONLY)"},{"line_number":104,"context_line":"            nrow_ncol \u003d ioctl_GWINSZ(fd)"},{"line_number":105,"context_line":"            os.close(fd)"},{"line_number":106,"context_line":"        except:"},{"line_number":107,"context_line":"            pass"},{"line_number":108,"context_line":"    if not nrow_ncol:"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMU%3D","line":105,"updated":"2011-09-14 16:27:18.000000000","message":"You\u0027ve got a file descriptor leak here if the open succeeds but the ioctl() fails.  Probably both would fail if one failed, but you never know...","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            if p.returncode \u003d\u003d 0:"},{"line_number":115,"context_line":"                return tuple(int(x) for x in p.stdout.read().split())"},{"line_number":116,"context_line":"        except:"},{"line_number":117,"context_line":"            nrow_ncol \u003d (DEFAULT_COL_LIMIT, DEFAULT_ROW_LIMIT)"},{"line_number":118,"context_line":"    return int(nrow_ncol[0]), int(nrow_ncol[1])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMQ%3D","line":117,"updated":"2011-09-14 16:27:18.000000000","message":"If the stty fails (returns non-zero), don\u0027t you want to return the default column/row limits anyway?  As written, if nrow_ncol fails and the stty returns a non-zero error code, you try to dereference nrow_ncol in the return after this if block, which will throw an exception.  Also, you shouldn\u0027t use p.stdout.read(); it would be better to use p.communicate() in place of the p.wait(), so you can get the output.","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    \"\"\""},{"line_number":125,"context_line":"    import sys"},{"line_number":126,"context_line":"    import tty"},{"line_number":127,"context_line":"    import termios"},{"line_number":128,"context_line":"    fd \u003d sys.stdin.fileno()"},{"line_number":129,"context_line":"    old \u003d termios.tcgetattr(fd)"},{"line_number":130,"context_line":"    try:"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMM%3D","line":127,"updated":"2011-09-14 16:27:18.000000000","message":"The \"import tty\" and \"import termios\" will fail on non-UNIX systems; you should wrap that in a try.  Also, the \"import sys\" shouldn\u0027t be inside the function, since it\u0027s always available; but it may already be imported near the beginning.","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        tty.setraw(fd)"},{"line_number":132,"context_line":"        return sys.stdin.read(1)"},{"line_number":133,"context_line":"    finally:"},{"line_number":134,"context_line":"        termios.tcsetattr(fd, termios.TCSADRAIN, old)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"def get_percent_done(image):"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMI%3D","line":134,"updated":"2011-09-14 16:27:18.000000000","message":"If this is run on non-UNIX, this instruction in the finally block will likely raise an exception (assuming the \"import termios\" worked, which it probably wouldn\u0027t).","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":542,"context_line":"            and \\"},{"line_number":543,"context_line":"            getTerminalSize()[0] - NROW_INDEX_COMPENSATION \\"},{"line_number":544,"context_line":"            or \\"},{"line_number":545,"context_line":"            (options.limit or getTerminalSize()[0] - NROW_INDEX_COMPENSATION)"},{"line_number":546,"context_line":"    marker \u003d options.marker"},{"line_number":547,"context_line":"    sort_key \u003d options.sort_key"},{"line_number":548,"context_line":"    sort_dir \u003d options.sort_dir"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BME%3D","line":545,"updated":"2011-09-14 16:27:18.000000000","message":"I would wrap the whole expression in parentheses so that you don\u0027t need the backslash continuations.  You need some parentheses anyway because you\u0027re mixing \"and\" and \"or\".  I also tend to prefer having the conjunctions (and/or) being at the end of a line, rather than on a line by themselves, but that\u0027s just a stylistic comment.","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"                    is received as response to prompt"},{"line_number":1184,"context_line":"    :param enter_to_confirm: True for raw_input style, False for getch style"},{"line_number":1185,"context_line":"    :param nline_to_erase: the num of line to be erase after confirmation,"},{"line_number":1186,"context_line":"                           it mainly for erasing the prompt in \u0027glance index\u0027"},{"line_number":1187,"context_line":"    \"\"\""},{"line_number":1188,"context_line":"    if default:"},{"line_number":1189,"context_line":"        prompt_default \u003d \"[Y/n]\""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BMA%3D","line":1186,"updated":"2011-09-14 16:27:18.000000000","message":"Try this for the parameter description:\n\n\"The number of lines to be erased after confirmation.  This is for erasing the prompt in \u0027glance index\u0027.\"\n\n(Not a blocker, just trying to be helpful)","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66cc2e467229b0c4bbc66dc7acf490504afdca86","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"        answer \u003d raw_input(\"%s %s \" % (prompt, prompt_default))"},{"line_number":1195,"context_line":"        answer.strip()"},{"line_number":1196,"context_line":"        sys.stdout.write(\"\\x1b[A\" * nline_to_erase)"},{"line_number":1197,"context_line":"        sys.stdout.flush()"},{"line_number":1198,"context_line":"        if answer \u003d\u003d \"\":"},{"line_number":1199,"context_line":"            return default"},{"line_number":1200,"context_line":"        else:"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAACH%2F%2F%2BL8%3D","line":1197,"updated":"2011-09-14 16:27:18.000000000","message":"I\u0027m a little worried as to whether this escape sequence would be portable...","commit_id":"aa1f154c517cd206e60fbbc1438627982f6d67f5"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"578e611f2cc1cc7e1589d108bfe406ec4ff9ff50","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                import fcntl"},{"line_number":96,"context_line":"                import termios"},{"line_number":97,"context_line":"                import struct"},{"line_number":98,"context_line":"                import os"},{"line_number":99,"context_line":"                ncol_nrow \u003d struct.unpack(\u0027hh\u0027,"},{"line_number":100,"context_line":"                        fcntl.ioctl(fd, termios.TIOCGWINSZ, \u00271234\u0027))"},{"line_number":101,"context_line":"            except:"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"AAAACX%2F%2F%2FUA%3D","line":98,"updated":"2011-09-22 15:55:19.000000000","message":"The os package is already imported, so you don\u0027t need to do that here.  Also, I have a slight preference that you import struct with all the other script imports...","commit_id":"97e23330adc84fa397b71b7b8e62dfe765d642bf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"578e611f2cc1cc7e1589d108bfe406ec4ff9ff50","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                import subprocess"},{"line_number":117,"context_line":"                cmd \u003d \"stty size\""},{"line_number":118,"context_line":"                p \u003d subprocess.Popen(cmd.split(), stdout\u003dsubprocess.PIPE)"},{"line_number":119,"context_line":"                return tuple(int(x) for x in p.communicate()[0].split())"},{"line_number":120,"context_line":"            except:"},{"line_number":121,"context_line":"                nrow_ncol \u003d (DEFAULT_ROW_LIMIT, DEFAULT_COL_LIMIT)"},{"line_number":122,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":4,"id":"AAAACX%2F%2F%2FT8%3D","line":119,"updated":"2011-09-22 15:55:19.000000000","message":"I think you\u0027re closer here, but I think you should also check the return code from stty; otherwise, the output you get won\u0027t quite match what you\u0027re expecting.  (It might throw an exception and fall through in that case, but I tend to prefer explicit checks...)  Also, cmd.split() doesn\u0027t make sense to me when you could just pass [\"stty\", \"size\"] to subprocess.Popen() directly.  Finally, I have a slight preference for importing subprocess with all the other imports at the top of the script.","commit_id":"97e23330adc84fa397b71b7b8e62dfe765d642bf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"578e611f2cc1cc7e1589d108bfe406ec4ff9ff50","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        finally:"},{"line_number":170,"context_line":"            termios.tcsetattr(fd, termios.TCSADRAIN, old)"},{"line_number":171,"context_line":"except:"},{"line_number":172,"context_line":"    from msvcrt import getch"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"def get_percent_done(image):"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"AAAACX%2F%2F%2FT4%3D","line":172,"updated":"2011-09-22 15:55:19.000000000","message":"I would incorporate the definition of getch into the prior try/except block, rather than giving it its own.  Also, the sys package is already imported, so you don\u0027t need to include it here.","commit_id":"97e23330adc84fa397b71b7b8e62dfe765d642bf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"578e611f2cc1cc7e1589d108bfe406ec4ff9ff50","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"    :param default: boolean value to return if empty string"},{"line_number":1219,"context_line":"                    is received as response to prompt"},{"line_number":1220,"context_line":"    :param RawInput: True for using build-in raw_input,"},{"line_number":1221,"context_line":"                     False for using getch()"},{"line_number":1222,"context_line":"    :param enter_to_confirm: True for pressing enter to confirm"},{"line_number":1223,"context_line":"                             while using getch()"},{"line_number":1224,"context_line":"    \"\"\""}],"source_content_type":"application/octet-stream","patch_set":4,"id":"AAAACX%2F%2F%2FT0%3D","line":1221,"updated":"2011-09-22 15:55:19.000000000","message":"We tend to prefer all-lowercase variable names, i.e., \"raw_input\", as opposed to CamelCase.","commit_id":"97e23330adc84fa397b71b7b8e62dfe765d642bf"}]}
