)]}'
{"glanceclient/shell.py":[{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"fb37fad0b581956216a1ec8912e5285121b5138f","unresolved":false,"context_lines":[{"line_number":549,"context_line":"        # argv and update it to no longer be unicode that way users don\u0027t see"},{"line_number":550,"context_line":"        # the pesky `u\u0027` prefix."},{"line_number":551,"context_line":"        for arg in args:"},{"line_number":552,"context_line":"            if not arg.startswith((\u0027-\u0027, \u0027--\u0027)):"},{"line_number":553,"context_line":"                subcommand_name \u003d arg"},{"line_number":554,"context_line":"                break"},{"line_number":555,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_f772bdaf","line":552,"range":{"start_line":552,"start_character":35,"end_line":552,"end_character":44},"updated":"2016-12-07 22:19:10.000000000","message":"Isn\u0027t the second list item redundant here? Wouldn\u0027t startswith(\u0027-\u0027) also match \u0027--\u0027?","commit_id":"0bd48fac0ba2b20208cbb419f37cd8b15f9e27ca"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"fb37fad0b581956216a1ec8912e5285121b5138f","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        if subcommand_name and six.PY2:"},{"line_number":559,"context_line":"            # NOTE(sigmavirus24): if we found a subcommand name, then let\u0027s"},{"line_number":560,"context_line":"            # find it in the argv list and replace it with a bytes object"},{"line_number":561,"context_line":"            # instead. Note, that if we decode the argument on Python 3, the"},{"line_number":562,"context_line":"            # user will isntead see a pesky `b\u0027` string instead of the `u\u0027`"},{"line_number":563,"context_line":"            # string we mention above."},{"line_number":564,"context_line":"            subcommand_index \u003d argv.index(subcommand_name)"},{"line_number":565,"context_line":"            argv[subcommand_index] \u003d encodeutils.safe_encode(subcommand_name)"},{"line_number":566,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_b76be584","line":563,"range":{"start_line":561,"start_character":23,"end_line":563,"end_character":37},"updated":"2016-12-07 22:19:10.000000000","message":"This comment confuses me, specifically the word \"decode\" in conjunction with the safe_encode() call.","commit_id":"0bd48fac0ba2b20208cbb419f37cd8b15f9e27ca"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"f4c9e4312dc9762684e27741f48e621a0e99c322","unresolved":false,"context_lines":[{"line_number":616,"context_line":"    def _fixup_subcommand(argv):"},{"line_number":617,"context_line":"        # NOTE(sigmavirus24): Sometimes users pass the wrong subcommand name"},{"line_number":618,"context_line":"        # to glanceclient. If they\u0027re using Python 2 they will see an error:"},{"line_number":619,"context_line":"        # \u003e invalid choice: u\u0027imgae-list\u0027 (choose from ...)"},{"line_number":620,"context_line":"        # To avoid this, we look at the extra args already parsed from above"},{"line_number":621,"context_line":"        # and try to predict what the subcommand will be based on it being the"},{"line_number":622,"context_line":"        # first non - or -- prefixed argument in args. We then find that in"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_531718a3","line":619,"updated":"2016-12-22 12:54:03.000000000","message":"Absolutely. :) The idea is that if you mis-type an existing command you still see the \"invalid choice\" error message from argparse. So I gave a rather realistic example.","commit_id":"8865991b50332ee966c97762fa29f443fa93c4da"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"09d82a051257a0447e82fb5983d4ed877fa52509","unresolved":false,"context_lines":[{"line_number":616,"context_line":"    def _fixup_subcommand(argv):"},{"line_number":617,"context_line":"        # NOTE(sigmavirus24): Sometimes users pass the wrong subcommand name"},{"line_number":618,"context_line":"        # to glanceclient. If they\u0027re using Python 2 they will see an error:"},{"line_number":619,"context_line":"        # \u003e invalid choice: u\u0027imgae-list\u0027 (choose from ...)"},{"line_number":620,"context_line":"        # To avoid this, we look at the extra args already parsed from above"},{"line_number":621,"context_line":"        # and try to predict what the subcommand will be based on it being the"},{"line_number":622,"context_line":"        # first non - or -- prefixed argument in args. We then find that in"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_8b8de17d","line":619,"updated":"2016-12-21 22:18:14.000000000","message":"is the typo in image intentional?","commit_id":"8865991b50332ee966c97762fa29f443fa93c4da"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"7c70adbedb1e085b6d1fb8564aa2852bd643346a","unresolved":false,"context_lines":[{"line_number":625,"context_line":"        for arg in argv:"},{"line_number":626,"context_line":"            if not arg.startswith(\u0027-\u0027):  # This will cover both - and --"},{"line_number":627,"context_line":"                subcommand_name \u003d arg"},{"line_number":628,"context_line":"                break"},{"line_number":629,"context_line":"        else:"},{"line_number":630,"context_line":"            subcommand_name \u003d \u0027\u0027"},{"line_number":631,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_ce25ed5c","line":628,"updated":"2017-01-10 18:54:23.000000000","message":"If argv is [\u0027--os-auth-token\u0027, \u0027tokenvalue\u0027, \u0027subcommand\u0027], won\u0027t this pick \u0027tokenvalue\u0027 as the subcommand?  Is there any downside to moving the \"if\" statement below up here and just safe_encoding all the possible subcommands?","commit_id":"8865991b50332ee966c97762fa29f443fa93c4da"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"7c70adbedb1e085b6d1fb8564aa2852bd643346a","unresolved":false,"context_lines":[{"line_number":634,"context_line":"            # NOTE(sigmavirus24): if we found a subcommand name, then let\u0027s"},{"line_number":635,"context_line":"            # find it in the argv list and replace it with a bytes object"},{"line_number":636,"context_line":"            # instead. Note, that if we encode the argument on Python 3, the"},{"line_number":637,"context_line":"            # user will isntead see a pesky `b\u0027` string instead of the `u\u0027`"},{"line_number":638,"context_line":"            # string we mention above."},{"line_number":639,"context_line":"            subcommand_index \u003d argv.index(subcommand_name)"},{"line_number":640,"context_line":"            argv[subcommand_index] \u003d encodeutils.safe_encode(subcommand_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_feb986ed","line":637,"range":{"start_line":637,"start_character":24,"end_line":637,"end_character":31},"updated":"2017-01-10 18:54:23.000000000","message":"The downside of not allowing typo fixes in comments is that we have to address them now!","commit_id":"8865991b50332ee966c97762fa29f443fa93c4da"}],"glanceclient/tests/unit/test_shell.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"24366e5f97d0abb4beded2a6fbf90e66088a389e","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def test_fixup_subcommand_with_options_preceding(self):"},{"line_number":179,"context_line":"        arglist \u003d [u\u0027--os-auth-token\u0027, u\u0027abcdef\u0027, u\u0027image-list\u0027, u\u0027--help\u0027]"},{"line_number":180,"context_line":"        unknown \u003d argslist[2:]"},{"line_number":181,"context_line":"        if six.PY2:"},{"line_number":182,"context_line":"            expected_arglist \u003d ["},{"line_number":183,"context_line":"                u\u0027--os-auth-token\u0027, u\u0027abcdef\u0027, b\u0027image-list\u0027, u\u0027--help\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_d181e590","line":180,"updated":"2017-01-11 13:32:42.000000000","message":"Thanks Dharini!","commit_id":"814ca1619e9f00849860270f5c85cf4a3d95c11e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"b9a33ab3d265f123cf19d04224a89bf5b256adde","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def test_fixup_subcommand_with_options_preceding(self):"},{"line_number":179,"context_line":"        arglist \u003d [u\u0027--os-auth-token\u0027, u\u0027abcdef\u0027, u\u0027image-list\u0027, u\u0027--help\u0027]"},{"line_number":180,"context_line":"        unknown \u003d argslist[2:]"},{"line_number":181,"context_line":"        if six.PY2:"},{"line_number":182,"context_line":"            expected_arglist \u003d ["},{"line_number":183,"context_line":"                u\u0027--os-auth-token\u0027, u\u0027abcdef\u0027, b\u0027image-list\u0027, u\u0027--help\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_2185a706","line":180,"range":{"start_line":180,"start_character":18,"end_line":180,"end_character":26},"updated":"2017-01-10 20:53:51.000000000","message":"arglist","commit_id":"814ca1619e9f00849860270f5c85cf4a3d95c11e"}]}
