)]}'
{"glanceclient/common/utils.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"09cc606840fbf93b49f834cad4bfb7a0372cb708","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    return _decorator"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def schema_args(schema_getter, omit\u003dNone, required\u003d[]):"},{"line_number":57,"context_line":"    omit \u003d omit or []"},{"line_number":58,"context_line":"    typemap \u003d {"},{"line_number":59,"context_line":"        \u0027string\u0027: str,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_0c96ae94","line":56,"updated":"2015-03-11 20:15:04.000000000","message":"I took it into cosideration when writting the code and I believe it\u0027s not better in this case, as this is clearer.\nThe reason why we don\u0027t have a problem with it is because it is used as is, no modification is done in the method as it is just used for checking if the argument from the schema is a required one.","commit_id":"b1797f979138639514bdc10f5117661317a36918"},{"author":{"_account_id":9096,"name":"Cindy Pallares","email":"u1@cindy.sh","username":"cpallares"},"change_message_id":"e1d4bb1dd65bd25f63530dbeff92e1ec86040e93","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    return _decorator"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def schema_args(schema_getter, omit\u003dNone, required\u003d[]):"},{"line_number":57,"context_line":"    omit \u003d omit or []"},{"line_number":58,"context_line":"    typemap \u003d {"},{"line_number":59,"context_line":"        \u0027string\u0027: str,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_51159fe3","line":56,"updated":"2015-03-11 19:58:06.000000000","message":"It would be better if required\u003dNone, then add something like:\nif required is None: required \u003d [] \n\nMutable default arguments can be tricky.","commit_id":"b1797f979138639514bdc10f5117661317a36918"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"97c10885feda220e8d29e85017ae3340ed452807","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def args_decorator(func):"},{"line_number":74,"context_line":"        def prepare_fields(fields):"},{"line_number":75,"context_line":"            args \u003d map(lambda x: \u0027--\u0027 + x.replace(\u0027_\u0027, \u0027-\u0027), fields)"},{"line_number":76,"context_line":"            return \u0027, \u0027.join(args)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        def func_wrapper(gc, args):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_d9c46060","line":75,"updated":"2015-05-17 23:18:59.000000000","message":"Sadly, map + lambda is more expensive than a generator or list comprehension. If you want to reap the benefits of being lazy (which may not be much in this case) you can do instead:\n\n     args \u003d (\u0027--\u0027 + x.replace(\u0027_\u0027, \u0027-\u0027) for x in fields)\n     return \u0027, \u0027.join(args)\n\nThis will avoid creating a list and will be good and lazy in the event this ever starts processing a larger number of fields.","commit_id":"e3dd86d8fc2aea6457a0df6efa021a046aa4a985"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d15e5c54384b9bd4bfc82f0a30d92b95debba3d9","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def args_decorator(func):"},{"line_number":74,"context_line":"        def prepare_fields(fields):"},{"line_number":75,"context_line":"            args \u003d map(lambda x: \u0027--\u0027 + x.replace(\u0027_\u0027, \u0027-\u0027), fields)"},{"line_number":76,"context_line":"            return \u0027, \u0027.join(args)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        def func_wrapper(gc, args):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_818174fd","line":75,"in_reply_to":"7a016987_d9c46060","updated":"2015-05-21 15:43:21.000000000","message":"Thanks, will change accordingly.","commit_id":"e3dd86d8fc2aea6457a0df6efa021a046aa4a985"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"97c10885feda220e8d29e85017ae3340ed452807","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"            # We use get_data_file to check if data is provided in stdin"},{"line_number":89,"context_line":"            if (present or get_data_file(args)) and missing:"},{"line_number":90,"context_line":"                msg \u003d (_(\"error: Must provide %(req)s when using %(opt)s.\") %"},{"line_number":91,"context_line":"                       {\u0027req\u0027: prepare_fields(missing),"},{"line_number":92,"context_line":"                        \u0027opt\u0027: prepare_fields(present) or \u0027stdin\u0027})"},{"line_number":93,"context_line":"                raise exc.CommandError(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_b9a2c4ac","line":90,"updated":"2015-05-17 23:18:59.000000000","message":"I think you\u0027re supposed to do\n\n    _(\"error: Must provide %(req)s when using %(opt)s.\", {\u0027req\u0027: prepare_fields(missing), \u0027opt\u0027: prepare_fields(present) or \u0027stdin\u0027})\n\nBut I have to double check if oslo.i18n allows dictionaries or if it prefers kwargs for interpolating like this.","commit_id":"e3dd86d8fc2aea6457a0df6efa021a046aa4a985"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"d30619eb61b7af11ecf2bdc42c212d3e81e086c6","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"            # We use get_data_file to check if data is provided in stdin"},{"line_number":89,"context_line":"            if (present or get_data_file(args)) and missing:"},{"line_number":90,"context_line":"                msg \u003d (_(\"error: Must provide %(req)s when using %(opt)s.\") %"},{"line_number":91,"context_line":"                       {\u0027req\u0027: prepare_fields(missing),"},{"line_number":92,"context_line":"                        \u0027opt\u0027: prepare_fields(present) or \u0027stdin\u0027})"},{"line_number":93,"context_line":"                raise exc.CommandError(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_45e368d9","line":90,"updated":"2015-05-22 18:55:53.000000000","message":"Sorry about that Gorka. I must have been confusing this for the case where you would do:\n\n    LOG.exception(_LE(\"...\"), params_to_interpolate)\n\nSorry for the confusion!","commit_id":"e3dd86d8fc2aea6457a0df6efa021a046aa4a985"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d15e5c54384b9bd4bfc82f0a30d92b95debba3d9","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"            # We use get_data_file to check if data is provided in stdin"},{"line_number":89,"context_line":"            if (present or get_data_file(args)) and missing:"},{"line_number":90,"context_line":"                msg \u003d (_(\"error: Must provide %(req)s when using %(opt)s.\") %"},{"line_number":91,"context_line":"                       {\u0027req\u0027: prepare_fields(missing),"},{"line_number":92,"context_line":"                        \u0027opt\u0027: prepare_fields(present) or \u0027stdin\u0027})"},{"line_number":93,"context_line":"                raise exc.CommandError(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_c18bec1d","line":90,"in_reply_to":"7a016987_b9a2c4ac","updated":"2015-05-21 15:43:21.000000000","message":"I think this actually does follow i18n guidelines and what you suggested would raise an exception because _ doesn\u0027t take additional arguments: https://github.com/openstack/oslo.i18n/blob/master/doc/source/guidelines.rst#adding-variables-to-translated-messages","commit_id":"e3dd86d8fc2aea6457a0df6efa021a046aa4a985"}],"glanceclient/tests/unit/v2/test_shell_v2.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"578abc4c26df37837eac41a8090971262dbccbc3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"def schema_args(schema_getter, omit\u003dNone):"},{"line_number":37,"context_line":"    global original_schema_args"},{"line_number":38,"context_line":"    # We only add the 2 arguments that are required by image-create"},{"line_number":39,"context_line":"    my_schema_getter \u003d lambda: {"},{"line_number":40,"context_line":"        \u0027properties\u0027: {"},{"line_number":41,"context_line":"            \u0027container_format\u0027: {"},{"line_number":42,"context_line":"                \u0027enum\u0027: [None, \u0027ami\u0027, \u0027ari\u0027, \u0027aki\u0027, \u0027bare\u0027, \u0027ovf\u0027, \u0027ova\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_05e9f0b6","line":39,"updated":"2015-05-22 18:55:54.000000000","message":"I must have missed this in PS6, but it is considered less than ideal to bind a lambda to a name. If you want a named function, the preferred way is to do\n\n    def schema_args(schema_getter, omit\u003dNone):\n        global original_schema_args\n        def my_schema_getter():\n            return { ... }\n        return original_schema_args(my_schema_getter, omit)","commit_id":"cb026ebbbe69d5d5c661c57398991d52981e38b1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"004fd60ddcd2575e1800d68b96a6b26f4d5db4e6","unresolved":false,"context_lines":[{"line_number":36,"context_line":"def schema_args(schema_getter, omit\u003dNone):"},{"line_number":37,"context_line":"    global original_schema_args"},{"line_number":38,"context_line":"    # We only add the 2 arguments that are required by image-create"},{"line_number":39,"context_line":"    my_schema_getter \u003d lambda: {"},{"line_number":40,"context_line":"        \u0027properties\u0027: {"},{"line_number":41,"context_line":"            \u0027container_format\u0027: {"},{"line_number":42,"context_line":"                \u0027enum\u0027: [None, \u0027ami\u0027, \u0027ari\u0027, \u0027aki\u0027, \u0027bare\u0027, \u0027ovf\u0027, \u0027ova\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_eb7e8ce2","line":39,"in_reply_to":"7a016987_05e9f0b6","updated":"2015-05-25 11:56:44.000000000","message":"I don\u0027t consider this to be a named lambda per se, since it is not being used to call the lambda but to increase readability, because including the lambda in line 53 would make this less readable.\n\nIf you like it better I can change it to a function like you suggest.","commit_id":"cb026ebbbe69d5d5c661c57398991d52981e38b1"}],"tests/v2/test_shell_v2.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"09cc606840fbf93b49f834cad4bfb7a0372cb708","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"#Set our own decorator that calls the original but with simulated schema"},{"line_number":33,"context_line":"def schema_args(schema_getter, omit\u003dNone, required\u003d[]):"},{"line_number":34,"context_line":"    global original_schema_args"},{"line_number":35,"context_line":"    # We only add the 2 arguments that are required by image-create"},{"line_number":36,"context_line":"    my_schema_getter \u003d lambda: {"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_2c91b29a","line":33,"updated":"2015-03-11 20:15:04.000000000","message":"Same as before :)","commit_id":"b1797f979138639514bdc10f5117661317a36918"},{"author":{"_account_id":9096,"name":"Cindy Pallares","email":"u1@cindy.sh","username":"cpallares"},"change_message_id":"e1d4bb1dd65bd25f63530dbeff92e1ec86040e93","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"#Set our own decorator that calls the original but with simulated schema"},{"line_number":33,"context_line":"def schema_args(schema_getter, omit\u003dNone, required\u003d[]):"},{"line_number":34,"context_line":"    global original_schema_args"},{"line_number":35,"context_line":"    # We only add the 2 arguments that are required by image-create"},{"line_number":36,"context_line":"    my_schema_getter \u003d lambda: {"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_f1e69315","line":33,"updated":"2015-03-11 19:58:06.000000000","message":"Same with this one.","commit_id":"b1797f979138639514bdc10f5117661317a36918"}]}
