)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"faef9d7849d6c4bee352fa84db7f766712a332f4","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Add a cell with a params dictionary and a %get command e.g.:"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"params\u003d{\u0027a\u0027: \u0027aaaa\u0027, \u0027b\u0027: \u0027bbbb\u0027}"},{"line_number":16,"context_line":"%get --input path:mycontainer/myobject --storlet mystorley.py"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Runnig this cell would execute mystorlet on mycontainer/myobject"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba5201f7_ade8a1b5","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":33},"updated":"2017-01-04 04:56:57.000000000","message":"params could be an option arg. we could be going to discuss on that in my patch.","commit_id":"252dbaafe5acc43b77b4f3a6b2e20f574cf73e78"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"faef9d7849d6c4bee352fa84db7f766712a332f4","unresolved":false,"context_lines":[{"line_number":16,"context_line":"%get --input path:mycontainer/myobject --storlet mystorley.py"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Runnig this cell would execute mystorlet on mycontainer/myobject"},{"line_number":19,"context_line":"get. The result will be in two variables: headers and content_iter"},{"line_number":20,"context_line":"So in the next cell one can do:"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"print headers"},{"line_number":23,"context_line":"for buf in content_iter"},{"line_number":24,"context_line":"    print buf"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"This patch is mainly to get feedback on the idea. Clearly it needs"},{"line_number":27,"context_line":"refactoring and a better way to return the result, e.g."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba5201f7_8d93dd4e","line":24,"range":{"start_line":19,"start_character":4,"end_line":24,"end_character":13},"updated":"2017-01-04 04:56:57.000000000","message":"Cool! This is awesome!","commit_id":"252dbaafe5acc43b77b4f3a6b2e20f574cf73e78"}],"doc/source/ipython_integration.rst":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    ::"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    %get --storlet test.py --input path:/\u003ccontainer\u003e/\u003cobject\u003e  -i myparams -o myresult"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"The invocation will execute test.py over the specified swift object with parameters read from myparams."},{"line_number":111,"context_line":"The result is placed in myresults."}],"source_content_type":"text/x-rst","patch_set":11,"id":"dfeb2761_18acb432","line":108,"range":{"start_line":108,"start_character":74,"end_line":108,"end_character":86},"updated":"2017-04-03 09:14:53.000000000","message":"Nice.","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"The invocation will execute test.py over the specified swift object with parameters read from myparams."},{"line_number":111,"context_line":"The result is placed in myresults."},{"line_number":112,"context_line":"The \u0027-i\u0027 argument is optional, however, if specified the supplied value must be a name of a defined variable."},{"line_number":113,"context_line":"myresults is a dictionary with the following keys:"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"#. status - An integer holding the Http response status"}],"source_content_type":"text/x-rst","patch_set":11,"id":"dfeb2761_38ff7835","line":112,"range":{"start_line":112,"start_character":0,"end_line":112,"end_character":108},"updated":"2017-04-03 09:14:53.000000000","message":"And should it be a dict instance?","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"#. headers - A dictionary holding the storlet invocation response headers"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"#. content_iter - An iterator over the response body"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"#. To invoke test.TestStorlet on a put just type the following:"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"dfeb2761_f88d90d3","line":119,"range":{"start_line":119,"start_character":0,"end_line":119,"end_character":52},"updated":"2017-04-03 09:14:53.000000000","message":"perhaps, an option like \"chunked\u003dTrue/False\" could be useful because caller may NOT want to consider the iteration chunks. Just resp[\u0027content\u0027] or Response object which supports resp.content would be intuitive for native http library (e.g. requests lib) users.","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"}],"storlets/tools/extensions/ipython.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"faef9d7849d6c4bee352fa84db7f766712a332f4","unresolved":false,"context_lines":[{"line_number":233,"context_line":"            src_container, src_obj, resp_chunk_size\u003d64 * 1024,"},{"line_number":234,"context_line":"            headers\u003dheaders)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        user_ns[\u0027headers\u0027] \u003d resp_headers"},{"line_number":237,"context_line":"        user_ns[\u0027content_iter\u0027] \u003d resp_content_iter"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"def load_ipython_extension(ipython):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_eda469a7","line":237,"range":{"start_line":236,"start_character":0,"end_line":237,"end_character":51},"updated":"2017-01-04 04:56:57.000000000","message":"Nice. And also L216 above is a magic for assignment in user space.","commit_id":"252dbaafe5acc43b77b4f3a6b2e20f574cf73e78"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            auth_url \u003d os.environ[\u0027OS_AUTH_URL\u0027]"},{"line_number":53,"context_line":"            auth_user \u003d os.environ[\u0027OS_USERNAME\u0027]"},{"line_number":54,"context_line":"            auth_password \u003d os.environ[\u0027OS_PASSWORD\u0027]"},{"line_number":55,"context_line":"            project_name \u003d os.environ[\u0027OS_PROJECT_NAME\u0027],"},{"line_number":56,"context_line":"        except KeyError:"},{"line_number":57,"context_line":"            raise UsageError("},{"line_number":58,"context_line":"                \"You need to set OS_AUTH_URL, OS_USERNAME, OS_PASSWORD and \""}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_d84c0ca0","side":"PARENT","line":55,"range":{"start_line":55,"start_character":56,"end_line":55,"end_character":57},"updated":"2017-04-03 09:14:53.000000000","message":"thx","commit_id":"5ee83694a9bd771e02e200ec989d9966598c5135"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                \u0027OS_USER_DOMAIN_NAME\u0027, \u0027Default\u0027),"},{"line_number":63,"context_line":"            \u0027project_domain_name\u0027: os.environ.get("},{"line_number":64,"context_line":"                \u0027OS_PROJECT_DOMAIN_NAME\u0027, \u0027Default\u0027),"},{"line_number":65,"context_line":"            \u0027project_name\u0027: project_name,"},{"line_number":66,"context_line":"        }"},{"line_number":67,"context_line":"        return Connection(auth_url, auth_user, auth_password,"},{"line_number":68,"context_line":"                          os_options\u003dauth_os_options,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_5860fc01","side":"PARENT","line":65,"range":{"start_line":65,"start_character":40,"end_line":65,"end_character":41},"updated":"2017-04-03 09:14:53.000000000","message":"nits) In the dict, the trailing comma should be safe.","commit_id":"5ee83694a9bd771e02e200ec989d9966598c5135"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _generate_params_headers(self, args):"},{"line_number":108,"context_line":"        headers \u003d {}"},{"line_number":109,"context_line":"        if not args.i:"},{"line_number":110,"context_line":"            return headers"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        user_ns \u003d self.shell.user_ns"},{"line_number":113,"context_line":"        params \u003d user_ns[args.i]"}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_fb710a0e","line":110,"range":{"start_line":109,"start_character":5,"end_line":110,"end_character":26},"updated":"2017-04-03 09:14:53.000000000","message":"I don\u0027t like to make this method covers the args existence check here. It should be done at the caller.","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        for key in params:"},{"line_number":117,"context_line":"            headers[\u0027X-Storlet-Parameter-%d\u0027 % i] \u003d\\"},{"line_number":118,"context_line":"                \u0027%s:%s\u0027 % (key, params[key])"},{"line_number":119,"context_line":"            i \u003d i + 1"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        return headers"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_3bc77248","line":119,"updated":"2017-04-03 09:14:53.000000000","message":"enumerate makes this easy.","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"}],"tests/unit/tools/extensions/test_ipython.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class FakeConnection(mock.MagicMock):"},{"line_number":26,"context_line":"    def get_object(self, *args, **kwargs):"},{"line_number":27,"context_line":"        if \u0027response_dict\u0027 in kwargs:"},{"line_number":28,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027status\u0027] \u003d self.returned_value"},{"line_number":29,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027headers\u0027] \u003d {}"},{"line_number":30,"context_line":"        return (mock.MagicMock(), mock.MagicMock())"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def copy_object(self, *args, **kwargs):"},{"line_number":33,"context_line":"        if \u0027response_dict\u0027 in kwargs:"},{"line_number":34,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027status\u0027] \u003d self.returned_value"},{"line_number":35,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027headers\u0027] \u003d {}"},{"line_number":36,"context_line":"        return (mock.MagicMock(), mock.MagicMock())"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def put_object(self, *args, **kwargs):"},{"line_number":39,"context_line":"        if \u0027response_dict\u0027 in kwargs:"},{"line_number":40,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027status\u0027] \u003d self.returned_value"},{"line_number":41,"context_line":"            kwargs[\u0027response_dict\u0027][\u0027headers\u0027] \u003d {}"},{"line_number":42,"context_line":"        return (mock.MagicMock(), mock.MagicMock())"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class TestStorletMagics(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_3692e99f","line":42,"range":{"start_line":26,"start_character":0,"end_line":42,"end_character":51},"updated":"2017-04-03 09:14:53.000000000","message":"why not making the FakeConnection more useful?","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c10a6082b177afea2be14be7a414c7f6bc1196e8","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        return _mockshell()"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def _test_get_stdout(self, status, line, shell, outvar_name):"},{"line_number":272,"context_line":"        self.fake_connection \u003d FakeConnection(returned_value\u003dstatus)"},{"line_number":273,"context_line":"        fake_stdout \u003d StringIO()"},{"line_number":274,"context_line":"        with mock.patch(\u0027sys.stdout\u0027, fake_stdout):"},{"line_number":275,"context_line":"            self.magics.shell \u003d shell"}],"source_content_type":"text/x-python","patch_set":11,"id":"dfeb2761_5609ed2e","line":272,"range":{"start_line":272,"start_character":8,"end_line":272,"end_character":28},"updated":"2017-04-03 09:14:53.000000000","message":"Don\u0027t overwrite preserved variable initialized at setUp(), the overwritten could cause brittle test cases, IMHO.\n\nIf we need brand new fake connection for other magics, i think we have a couple of ways to enable it.\n\n1. Create a new test class which setUps the self.fake_connection for the usecase\n\n2. generarize _call_xx method just packing like as decorator\n\nThe easy way seems 1, i think option 2 is a tricky one.\n\nThe draft sketch for option 1 is here, https://review.openstack.org/#/c/452649/","commit_id":"0f0b4ca509df1cfd6e66c920d2363b5306f217ce"}]}
