)]}'
{"nova/tests/test_utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"580249c65fdf3a684086d340f9996a818e65e249","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            \u0027junk1KB\u0027, \u00271023BBBB\u0027,"},{"line_number":70,"context_line":"        ]"},{"line_number":71,"context_line":"        for v in breaking_examples:"},{"line_number":72,"context_line":"            with self.assertRaises(TypeError):"},{"line_number":73,"context_line":"                utils.to_bytes(v)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F4bk%3D","line":72,"updated":"2012-10-30 21:34:14.000000000","message":"Sorry, we can\u0027t use self.assertRaises() with the \u0027with\u0027 statement in the nova test suite.  You\u0027ll have to revert this to:\n\n    self.assertRaises(TypeError, utils.to_bytes, v)","commit_id":"1d6020c6973c6f68c7a0658501b32aec30b1a3e7"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e3b07c66d5cd0adbd3b0f43d31f6597523602dc4","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            \u0027junk1KB\u0027, \u00271023BBBB\u0027,"},{"line_number":70,"context_line":"        ]"},{"line_number":71,"context_line":"        for v in breaking_examples:"},{"line_number":72,"context_line":"            with self.assertRaises(TypeError):"},{"line_number":73,"context_line":"                utils.to_bytes(v)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F20w%3D","line":72,"in_reply_to":"AAAALn%2F%2F4bk%3D","updated":"2012-11-01 03:04:26.000000000","message":"Durn.","commit_id":"1d6020c6973c6f68c7a0658501b32aec30b1a3e7"}],"nova/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":584,"context_line":"    \"\"\""},{"line_number":585,"context_line":"    byte_val \u003d 0"},{"line_number":586,"context_line":"    if not text:"},{"line_number":587,"context_line":"        return byte_val"},{"line_number":588,"context_line":"    text \u003d text.strip()"},{"line_number":589,"context_line":"    if not text:"},{"line_number":590,"context_line":"        return byte_val"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7EU%3D","line":587,"updated":"2012-10-26 21:29:52.000000000","message":"I would eliminate this clause and just rely on the (identical) clause after the text \u003d text.strip() line.","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    elif text[-1].upper() \u003d\u003d \u0027K\u0027:"},{"line_number":602,"context_line":"        byte_val \u003d int(text[0:-1]) * 1024"},{"line_number":603,"context_line":"    elif text[-1].upper() \u003d\u003d \u0027B\u0027:"},{"line_number":604,"context_line":"        byte_val \u003d int(text[0:-1])"},{"line_number":605,"context_line":"    else:"},{"line_number":606,"context_line":"        byte_val \u003d int(text)"},{"line_number":607,"context_line":"    return byte_val"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7EQ%3D","line":604,"updated":"2012-10-26 21:29:52.000000000","message":"You\u0027ve already eliminated the trailing \u0027B\u0027, so to specify bytes, you have to use \u0027BB\u0027, which seems nonsensical to me.","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":604,"context_line":"        byte_val \u003d int(text[0:-1])"},{"line_number":605,"context_line":"    else:"},{"line_number":606,"context_line":"        byte_val \u003d int(text)"},{"line_number":607,"context_line":"    return byte_val"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":""},{"line_number":610,"context_line":"def delete_if_exists(pathname):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7Dw%3D","line":607,"updated":"2012-10-26 21:29:52.000000000","message":"I think this function can be simplified quite a bit.  Consider the following PoC code:\n\n    multiplier \u003d dict(b\u003d1, tb\u003d1024 ** 4, gb\u003d1024 ** 3, mb\u003d1024 ** 2, kb\u003d1024)\n    def to_bytes(text):\n        mult \u003d text.strip(\u00271234567890\u0027)\n        try:\n            return int(text[:-len(mult)]) * multiplier[mult]\n        except (ValueError, KeyError):\n            return 0\n\nHere are some results from that:\n\n    \u003e\u003e\u003e to_bytes(\u002734b\u0027)\n    34\n    \u003e\u003e\u003e to_bytes(\u002734kb\u0027)\n    34816\n    \u003e\u003e\u003e to_bytes(\u002734tb\u0027)\n    37383395344384\n    \u003e\u003e\u003e to_bytes(\u002734tbb\u0027)\n    0","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"918cefc6c78a854eb723c1e8e02f9427cb8fdc03","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                help\u003d\u0027Whether to disable inter-process locks\u0027))"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"# Used for looking up extensions of text"},{"line_number":67,"context_line":"# to there \u0027multipled\u0027 byte amount"},{"line_number":68,"context_line":"BYTE_MULTIPLERS \u003d {"},{"line_number":69,"context_line":"    \u0027b\u0027: 1,"},{"line_number":70,"context_line":"    \u0027tb\u0027: 1024 ** 4,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F6%2BE%3D","line":67,"updated":"2012-10-26 23:03:44.000000000","message":"femtonit: \"their\" is the third-person possessive :)","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"918cefc6c78a854eb723c1e8e02f9427cb8fdc03","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"# Used for looking up extensions of text"},{"line_number":67,"context_line":"# to there \u0027multipled\u0027 byte amount"},{"line_number":68,"context_line":"BYTE_MULTIPLERS \u003d {"},{"line_number":69,"context_line":"    \u0027b\u0027: 1,"},{"line_number":70,"context_line":"    \u0027tb\u0027: 1024 ** 4,"},{"line_number":71,"context_line":"    \u0027t\u0027: 1024 ** 4,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F69Y%3D","line":68,"updated":"2012-10-26 23:03:44.000000000","message":"You misspelled \"multipliers\"—notice the \u0027i\u0027 before the \u0027e\u0027.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"918cefc6c78a854eb723c1e8e02f9427cb8fdc03","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        raise TypeError(\"Unknown byte multipler %r\" % mult_key)"},{"line_number":602,"context_line":"    multiplier \u003d BYTE_MULTIPLERS.get(mult_key)"},{"line_number":603,"context_line":"    try:"},{"line_number":604,"context_line":"        if multiplier is not None:"},{"line_number":605,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F69s%3D","line":604,"updated":"2012-10-26 23:03:44.000000000","message":"\"multiplier\" cannot possibly be None here, because you already raise TypeError if it\u0027s not in BYTE_MULTIPLERS.  Either eliminate the \"mult_key in BYTE_MULTIPLERS\" check before the try or eliminate this if and use the default argument to .get().  Or, for that matter, just simplify this to:\n\n    try:\n        return int(text) * BYTE_MULTIPLERS[mult_key]\n    except (ValueError, KeyError):\n        return default","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"9d3716ac65979be687f8fcc50c0ff30d0e7c0f28","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        raise TypeError(\"Unknown byte multipler %r\" % mult_key)"},{"line_number":602,"context_line":"    multiplier \u003d BYTE_MULTIPLERS.get(mult_key)"},{"line_number":603,"context_line":"    try:"},{"line_number":604,"context_line":"        if multiplier is not None:"},{"line_number":605,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F558%3D","line":604,"in_reply_to":"AAAALn%2F%2F568%3D","updated":"2012-10-29 17:36:19.000000000","message":"OK, hang on, I see now how mult_key can be the empty string; I missed the \u0027if mult_key\u0027 part of your \u0027raise TypeError\u0027 logic.  The solution here is trivial, though; add an empty key to BYTE_MULTIPLERS.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"1fa808767afe02650a90536cf0b44abed2693715","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        raise TypeError(\"Unknown byte multipler %r\" % mult_key)"},{"line_number":602,"context_line":"    multiplier \u003d BYTE_MULTIPLERS.get(mult_key)"},{"line_number":603,"context_line":"    try:"},{"line_number":604,"context_line":"        if multiplier is not None:"},{"line_number":605,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F568%3D","line":604,"in_reply_to":"AAAALn%2F%2F68Y%3D","updated":"2012-10-29 17:28:55.000000000","message":"No, it can\u0027t, even if mult_key is empty.  In the case you cite, mult_key becomes the empty string, which isn\u0027t a valid key in BYTE_MULTIPLERS, so in your above logic, you\u0027ll already have raised a TypeError and bailed out.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"9f85edc05ea10c8610be161ba8c9a32ed9b425c2","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        raise TypeError(\"Unknown byte multipler %r\" % mult_key)"},{"line_number":602,"context_line":"    multiplier \u003d BYTE_MULTIPLERS.get(mult_key)"},{"line_number":603,"context_line":"    try:"},{"line_number":604,"context_line":"        if multiplier is not None:"},{"line_number":605,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F68Y%3D","line":604,"in_reply_to":"AAAALn%2F%2F69s%3D","updated":"2012-10-26 23:07:35.000000000","message":"It can be, if mult_key is empty (ie the text is just a number).","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"918cefc6c78a854eb723c1e8e02f9427cb8fdc03","unresolved":false,"context_lines":[{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"},{"line_number":608,"context_line":"        return int(text) * multiplier"},{"line_number":609,"context_line":"    except (TypeError, ValueError):"},{"line_number":610,"context_line":"        return default"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F69k%3D","line":609,"updated":"2012-10-26 23:03:44.000000000","message":"Where can TypeError be thrown in this try block?  As far as I can see, the only place this could happen is in \"int(text)\", which would only throw ValueError.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"9f85edc05ea10c8610be161ba8c9a32ed9b425c2","unresolved":false,"context_lines":[{"line_number":606,"context_line":"        else:"},{"line_number":607,"context_line":"            multiplier \u003d 1"},{"line_number":608,"context_line":"        return int(text) * multiplier"},{"line_number":609,"context_line":"    except (TypeError, ValueError):"},{"line_number":610,"context_line":"        return default"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F68Q%3D","line":609,"in_reply_to":"AAAALn%2F%2F69k%3D","updated":"2012-10-26 23:07:35.000000000","message":"Some other object that implements lstrip and lower but doesn\u0027t implement int() conversion, can leave it out i suppose.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"7a217e4ead8056eca7a67c7b7206f0d97b21325d","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        raise TypeError(msg)"},{"line_number":603,"context_line":"    multiplier \u003d BYTE_MULTIPLIERS.get(mult_key)"},{"line_number":604,"context_line":"    try:"},{"line_number":605,"context_line":"        if multiplier is not None:"},{"line_number":606,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":607,"context_line":"        else:"},{"line_number":608,"context_line":"            # Must of had no multipler, assume bytes"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F560%3D","line":605,"updated":"2012-10-29 17:30:37.000000000","message":"Again, multiplier cannot possibly be None here, and this logic can be vastly simplified as per my previous comment.","commit_id":"13d90ef66d7eff2015b5ef733fc2f3c92e357199"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2525d4de4e5384ad6e32d4a03bf1c92bffa70f19","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        raise TypeError(msg)"},{"line_number":603,"context_line":"    multiplier \u003d BYTE_MULTIPLIERS.get(mult_key)"},{"line_number":604,"context_line":"    try:"},{"line_number":605,"context_line":"        if multiplier is not None:"},{"line_number":606,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":607,"context_line":"        else:"},{"line_number":608,"context_line":"            # Must of had no multipler, assume bytes"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F56Q%3D","line":605,"in_reply_to":"AAAALn%2F%2F560%3D","updated":"2012-10-29 17:34:18.000000000","message":"\u003e\u003e\u003e mult_key \u003d \u0027\u0027\n\u003e\u003e\u003e if mult_key:\n...   print \"GOT HERE\"\n... \n\u003e\u003e\u003e\n\nIn python empty strings are false :-)","commit_id":"13d90ef66d7eff2015b5ef733fc2f3c92e357199"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"01a9e131927b1d7f2a9791937c3ec3f596a7c800","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        raise TypeError(msg)"},{"line_number":603,"context_line":"    multiplier \u003d BYTE_MULTIPLIERS.get(mult_key)"},{"line_number":604,"context_line":"    try:"},{"line_number":605,"context_line":"        if multiplier is not None:"},{"line_number":606,"context_line":"            text \u003d text[0:-len(mult_key)]"},{"line_number":607,"context_line":"        else:"},{"line_number":608,"context_line":"            # Must of had no multipler, assume bytes"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F55k%3D","line":605,"in_reply_to":"AAAALn%2F%2F56Q%3D","updated":"2012-10-29 17:42:06.000000000","message":"Yes, I missed the \u0027mult_key\u0027 check in your TypeError logic above.  However, I don\u0027t think it\u0027s necessary; simply add the empty string mapping to 1 in BYTE_MULTIPLIERS.  (For that matter, if you were to preserve your existing logic (which I think is needlessly complex), you can just do:\n\n    multiplier \u003d BYTE_MULTIPLIERS.get(mult_key, 1)\n\nI still think it\u0027s needlessly complex, however.  Maybe something more like:\n\n    to_bytes(text, default\u003d0):\n        mult_key \u003d text.lstrip(\u0027-1234567890\u0027).lower()\n        try:\n            return int(text) * BYTE_MULTIPLIERS[mult_key]\n        except KeyError:\n            msg \u003d _(\u0027Unknown byte multiplier: %s\u0027) % mult_key\n            raise TypeError(msg)\n        except ValueError:\n            return default\n\n(Along with the addition of \u0027\u0027 to the BYTE_MULTIPLIERS dict.)","commit_id":"13d90ef66d7eff2015b5ef733fc2f3c92e357199"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"580249c65fdf3a684086d340f9996a818e65e249","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        msg \u003d _(\u0027Unknown byte multiplier: %s\u0027) % mult_key_org"},{"line_number":610,"context_line":"        raise TypeError(msg)"},{"line_number":611,"context_line":"    except ValueError:"},{"line_number":612,"context_line":"        return default"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"def delete_if_exists(pathname):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F4bc%3D","line":612,"updated":"2012-10-30 21:34:14.000000000","message":"OK, I\u0027m happier with this","commit_id":"1d6020c6973c6f68c7a0658501b32aec30b1a3e7"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e3b07c66d5cd0adbd3b0f43d31f6597523602dc4","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        msg \u003d _(\u0027Unknown byte multiplier: %s\u0027) % mult_key_org"},{"line_number":610,"context_line":"        raise TypeError(msg)"},{"line_number":611,"context_line":"    except ValueError:"},{"line_number":612,"context_line":"        return default"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"def delete_if_exists(pathname):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F20s%3D","line":612,"in_reply_to":"AAAALn%2F%2F4bc%3D","updated":"2012-11-01 03:04:26.000000000","message":"Woot!","commit_id":"1d6020c6973c6f68c7a0658501b32aec30b1a3e7"}],"nova/virt/images.py":[{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"1a1edcf9c491aec1ccd4ea6a2944dfe88263e5d0","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # Standardize on underscores/lc/no dash and no spaces"},{"line_number":59,"context_line":"        # since qemu seems to have mixed outputs here... and"},{"line_number":60,"context_line":"        # this format allows for better integration with python"},{"line_number":61,"context_line":"        field \u003d field.lower().strip().replace(\" \", \"_\").replace(\"-\", \"_\")"},{"line_number":62,"context_line":"        data[field] \u003d val"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    return data"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FOfw%3D","line":61,"updated":"2012-10-02 18:41:55.000000000","message":"It might be nice to pull this up into a common function that could be used other places.","commit_id":"b9cb3eb2a0f771ee77dbfc84ddf0b5d53735c520"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b8bf706acba14ebe0debd8dd8d7d2274c1d1aee4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return json.dumps(self._details, indent\u003d4)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def __getattr__(self, name):"},{"line_number":61,"context_line":"        if not name in self._details:"},{"line_number":62,"context_line":"            raise AttributeError(\"No attribute named %s\" % (name))"},{"line_number":63,"context_line":"        return self._details[name]"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALn%2F%2F8lk%3D","line":61,"updated":"2012-10-25 15:15:23.000000000","message":"I think it\u0027d be a little tiny bit clearer as \"if name not in self._details\" (attonit)","commit_id":"6af6a59b898f9cd031cec6e8df2796c56de0a0c0"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2b20485c7f408c9d3626714bfb645246996934d4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return json.dumps(self._details, indent\u003d4)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def __getattr__(self, name):"},{"line_number":61,"context_line":"        if not name in self._details:"},{"line_number":62,"context_line":"            raise AttributeError(\"No attribute named %s\" % (name))"},{"line_number":63,"context_line":"        return self._details[name]"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALn%2F%2F73w%3D","line":61,"in_reply_to":"AAAALn%2F%2F8lk%3D","updated":"2012-10-26 03:49:34.000000000","message":"+1 to Vek\u0027s comment.","commit_id":"6af6a59b898f9cd031cec6e8df2796c56de0a0c0"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2b20485c7f408c9d3626714bfb645246996934d4","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def __getattr__(self, name):"},{"line_number":61,"context_line":"        if not name in self._details:"},{"line_number":62,"context_line":"            raise AttributeError(\"No attribute named %s\" % (name))"},{"line_number":63,"context_line":"        return self._details[name]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __contains__(self, item):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALn%2F%2F73o%3D","line":62,"updated":"2012-10-26 03:49:34.000000000","message":"Extra parens around \u0027name\u0027 not needed.","commit_id":"6af6a59b898f9cd031cec6e8df2796c56de0a0c0"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2b20485c7f408c9d3626714bfb645246996934d4","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                                                                lines[i + 1:])"},{"line_number":178,"context_line":"                root \u003d self._adjust_root_name(root)"},{"line_number":179,"context_line":"                contents[root] \u003d details"},{"line_number":180,"context_line":"            i +\u003d max(consumed_lines, 0) + 1"},{"line_number":181,"context_line":"        # Ensure some keys are always there"},{"line_number":182,"context_line":"        for k in [\u0027backing_file\u0027, \u0027image\u0027, \u0027file_format\u0027]:"},{"line_number":183,"context_line":"            k \u003d self._adjust_root_name(k)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALn%2F%2F74A%3D","line":180,"updated":"2012-10-26 03:49:34.000000000","message":"Not sure I see the reason for \u0027max\u0027 here..  could just be: i +\u003d consumed_lines + 1?","commit_id":"6af6a59b898f9cd031cec6e8df2796c56de0a0c0"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2b20485c7f408c9d3626714bfb645246996934d4","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        for k in [\u0027backing_file\u0027, \u0027image\u0027, \u0027file_format\u0027]:"},{"line_number":183,"context_line":"            k \u003d self._adjust_root_name(k)"},{"line_number":184,"context_line":"            if k not in contents:"},{"line_number":185,"context_line":"                contents[k] \u003d None"},{"line_number":186,"context_line":"        return contents"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALn%2F%2F730%3D","line":185,"updated":"2012-10-26 03:49:34.000000000","message":"Could just init these at the top?  Avoids need for \u0027if\u0027.","commit_id":"6af6a59b898f9cd031cec6e8df2796c56de0a0c0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        ]"},{"line_number":73,"context_line":"        if self.snapshots:"},{"line_number":74,"context_line":"            lines.append(\"snapshots:\")"},{"line_number":75,"context_line":"            lines.append(str(self.snapshots))"},{"line_number":76,"context_line":"        return \"\\n\".join(lines)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _canonicalize(self, field):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7Ds%3D","line":75,"updated":"2012-10-26 21:29:52.000000000","message":"If you\u0027re just going to str-ify snapshots, I\u0027d slightly prefer:\n\n    lines.append(\"snapshots: %s\" % self.snapshots)","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        elif root_cmd \u003d\u003d \u0027snapshot_list\u0027:"},{"line_number":116,"context_line":"            # Next line should be a header, starting with \u0027ID\u0027"},{"line_number":117,"context_line":"            if not lines_after or not lines_after[0].startswith(\"ID\"):"},{"line_number":118,"context_line":"                raise ValueError((\"Snapshot list encountered \""},{"line_number":119,"context_line":"                                  \"but no header found!\"))"},{"line_number":120,"context_line":"            consumed_lines +\u003d 1"},{"line_number":121,"context_line":"            possible_contents \u003d lines_after[1:]"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7Dg%3D","line":118,"updated":"2012-10-26 21:29:52.000000000","message":"Were you meaning to internationalize this?","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"cf4df3d1c6a76c14323365b548de1ce9ff057d80","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        elif root_cmd \u003d\u003d \u0027snapshot_list\u0027:"},{"line_number":116,"context_line":"            # Next line should be a header, starting with \u0027ID\u0027"},{"line_number":117,"context_line":"            if not lines_after or not lines_after[0].startswith(\"ID\"):"},{"line_number":118,"context_line":"                raise ValueError((\"Snapshot list encountered \""},{"line_number":119,"context_line":"                                  \"but no header found!\"))"},{"line_number":120,"context_line":"            consumed_lines +\u003d 1"},{"line_number":121,"context_line":"            possible_contents \u003d lines_after[1:]"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F6%2B4%3D","line":118,"in_reply_to":"AAAALn%2F%2F7Dg%3D","updated":"2012-10-26 22:27:47.000000000","message":"Ah yes, forgot that we were still internationalizing exception messages.","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2979498035c79b9fc66e1c5705224a206fcd69d6","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        i \u003d 0"},{"line_number":160,"context_line":"        line_am \u003d len(lines)"},{"line_number":161,"context_line":"        while i \u003c line_am:"},{"line_number":162,"context_line":"            line \u003d lines[i]"},{"line_number":163,"context_line":"            if not line.strip():"},{"line_number":164,"context_line":"                i +\u003d 1"},{"line_number":165,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7C0%3D","line":162,"updated":"2012-10-26 21:29:52.000000000","message":"This feels kinda ugly.  I understand why you\u0027re doing it, because of the variable length consumption of _extract_details(), but I can\u0027t help thinking there must be a way to clean this up…","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"cf4df3d1c6a76c14323365b548de1ce9ff057d80","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        i \u003d 0"},{"line_number":160,"context_line":"        line_am \u003d len(lines)"},{"line_number":161,"context_line":"        while i \u003c line_am:"},{"line_number":162,"context_line":"            line \u003d lines[i]"},{"line_number":163,"context_line":"            if not line.strip():"},{"line_number":164,"context_line":"                i +\u003d 1"},{"line_number":165,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F6%2B0%3D","line":162,"in_reply_to":"AAAALn%2F%2F7C0%3D","updated":"2012-10-26 22:27:47.000000000","message":"I wouldn\u0027t mind also, but things that iterate over entries won\u0027t work to well when I jump around due to later consumption.","commit_id":"cf5c2ecdae793d2230964234fbb64e411cf16f34"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"918cefc6c78a854eb723c1e8e02f9427cb8fdc03","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        i \u003d 0"},{"line_number":156,"context_line":"        line_am \u003d len(lines)"},{"line_number":157,"context_line":"        while i \u003c line_am:"},{"line_number":158,"context_line":"            line \u003d lines[i]"},{"line_number":159,"context_line":"            if not line.strip():"},{"line_number":160,"context_line":"                i +\u003d 1"},{"line_number":161,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F69E%3D","line":158,"updated":"2012-10-26 23:03:44.000000000","message":"Indeed.  I can think of methods involving objects or generators, but that\u0027s probably a little too complicated anyway.  Oh, well…","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"75ab0f966b77387e0a511604d5350e292668421b","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        i \u003d 0"},{"line_number":156,"context_line":"        line_am \u003d len(lines)"},{"line_number":157,"context_line":"        while i \u003c line_am:"},{"line_number":158,"context_line":"            line \u003d lines[i]"},{"line_number":159,"context_line":"            if not line.strip():"},{"line_number":160,"context_line":"                i +\u003d 1"},{"line_number":161,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAALn%2F%2F658%3D","line":158,"in_reply_to":"AAAALn%2F%2F69E%3D","updated":"2012-10-26 23:48:40.000000000","message":"Ya, those types of thinks may be more complicated than a slightly complex while loop.","commit_id":"45de9c28a44f29d3910a45185f97e46932d0d604"}]}
