)]}'
{"quantum/tests/unit/test_db_plugin.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":586,"context_line":"    def _test_list_with_pagination_reverse(self, collection, items, sort,"},{"line_number":587,"context_line":"                                           limit, expected_page_num,"},{"line_number":588,"context_line":"                                           query_params\u003d\u0027\u0027):"},{"line_number":589,"context_line":"        if self.fmt \u003d\u003d \u0027xml\u0027:"},{"line_number":590,"context_line":"            self.skipTest(\"Skip xml test for pagination\")"},{"line_number":591,"context_line":"        resources \u003d \u0027%ss\u0027 % collection"},{"line_number":592,"context_line":"        collection \u003d collection.replace(\u0027-\u0027, \u0027_\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuFM%3D","side":"PARENT","line":589,"updated":"2013-02-20 19:22:35.000000000","message":"You need to do the same for test_list_with_pagination","commit_id":"50bfc9a7bd4e8a4e581e7d14ef69bb7724618984"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":586,"context_line":"    def _test_list_with_pagination_reverse(self, collection, items, sort,"},{"line_number":587,"context_line":"                                           limit, expected_page_num,"},{"line_number":588,"context_line":"                                           query_params\u003d\u0027\u0027):"},{"line_number":589,"context_line":"        if self.fmt \u003d\u003d \u0027xml\u0027:"},{"line_number":590,"context_line":"            self.skipTest(\"Skip xml test for pagination\")"},{"line_number":591,"context_line":"        resources \u003d \u0027%ss\u0027 % collection"},{"line_number":592,"context_line":"        collection \u003d collection.replace(\u0027-\u0027, \u0027_\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtUA%3D","side":"PARENT","line":589,"in_reply_to":"AAAAM3%2F%2BuFM%3D","updated":"2013-02-21 04:23:30.000000000","message":"Done","commit_id":"50bfc9a7bd4e8a4e581e7d14ef69bb7724618984"}],"quantum/wsgi.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def default(self, data):"},{"line_number":258,"context_line":"        # We expect data to contain a single key which is the XML root or"},{"line_number":259,"context_line":"        # non root"},{"line_number":260,"context_line":"        try:"},{"line_number":261,"context_line":"            has_atom \u003d False"},{"line_number":262,"context_line":"            links \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuUY%3D","line":259,"updated":"2013-02-20 19:22:35.000000000","message":"Uhm... do we need to update this comment?","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def default(self, data):"},{"line_number":258,"context_line":"        # We expect data to contain a single key which is the XML root or"},{"line_number":259,"context_line":"        # non root"},{"line_number":260,"context_line":"        try:"},{"line_number":261,"context_line":"            has_atom \u003d False"},{"line_number":262,"context_line":"            links \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtT4%3D","line":259,"in_reply_to":"AAAAM3%2F%2BuUY%3D","updated":"2013-02-21 04:23:30.000000000","message":"Done","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":274,"context_line":"                        root_value \u003d data[key]"},{"line_number":275,"context_line":"            if key_len !\u003d 1 and not links:"},{"line_number":276,"context_line":"                root_key \u003d constants.VIRTUAL_ROOT_KEY"},{"line_number":277,"context_line":"                root_value \u003d data"},{"line_number":278,"context_line":"            doc \u003d etree.Element(\"_temp_root\")"},{"line_number":279,"context_line":"            used_prefixes \u003d []"},{"line_number":280,"context_line":"            self._to_xml_node(doc, self.metadata, root_key,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuQ4%3D","line":277,"updated":"2013-02-20 19:22:35.000000000","message":"This logic is getting complicated.\ncase 1) single key -\u003e that\u0027s the root key\ncase 2) exactly two keys and one are the link\ncase 3) two or more keys, but no links\n\nCould the following work?\n\nlinks\u003dNone\nlink_keys \u003d [(k for (k, v) in data.iteritems() if k.endswith(\u0027_links\u0027)]\nif link_keys:\n    links \u003d data.pop(link_keys[0], None)\n    has_atom\u003dTrue \n\nroot_key \u003d len(data) \u003d\u003d 1 and data.keys()[0] or constants.VIRTUAL_ROOT_KEY\nroot_value \u003d data.get(root_key, data)\n\nAlso has_atom is probably not necessary, but I think it helps readability","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                        root_value \u003d data[key]"},{"line_number":275,"context_line":"            if key_len !\u003d 1 and not links:"},{"line_number":276,"context_line":"                root_key \u003d constants.VIRTUAL_ROOT_KEY"},{"line_number":277,"context_line":"                root_value \u003d data"},{"line_number":278,"context_line":"            doc \u003d etree.Element(\"_temp_root\")"},{"line_number":279,"context_line":"            used_prefixes \u003d []"},{"line_number":280,"context_line":"            self._to_xml_node(doc, self.metadata, root_key,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtC4%3D","line":277,"in_reply_to":"AAAAM3%2F%2BuQ4%3D","updated":"2013-02-21 04:23:30.000000000","message":"Done, use data.iterkeys() instead of data.iteritems(). and has_atom used for add atom namespace","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":484,"context_line":"        link_nodes \u003d node.findall(constants.ATOM_LINK_NOTATION)"},{"line_number":485,"context_line":"        root_tag \u003d self._get_key(node.tag)"},{"line_number":486,"context_line":"        link_key \u003d \"%s_links\" % root_tag"},{"line_number":487,"context_line":"        link_dict \u003d {}"},{"line_number":488,"context_line":"        for link in link_nodes:"},{"line_number":489,"context_line":"            if not link_dict:"},{"line_number":490,"context_line":"                link_dict[link_key] \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuVs%3D","line":487,"updated":"2013-02-20 19:22:35.000000000","message":"link_dict appear to have only a single key (link_key).\nThen probably... it\u0027s not a dict.\n\nfor link in link_nodes:\n     link_list.append({\u0027rel\": link.get(\u0027rel\u0027),\n                               \u0027href\u0027: link.get(\u0027href\u0027)})\n     node.remove(link)\nreturn {link_key: link_list}","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        link_nodes \u003d node.findall(constants.ATOM_LINK_NOTATION)"},{"line_number":485,"context_line":"        root_tag \u003d self._get_key(node.tag)"},{"line_number":486,"context_line":"        link_key \u003d \"%s_links\" % root_tag"},{"line_number":487,"context_line":"        link_dict \u003d {}"},{"line_number":488,"context_line":"        for link in link_nodes:"},{"line_number":489,"context_line":"            if not link_dict:"},{"line_number":490,"context_line":"                link_dict[link_key] \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtCw%3D","line":487,"in_reply_to":"AAAAM3%2F%2BuVs%3D","updated":"2013-02-21 04:23:30.000000000","message":"Done","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":490,"context_line":"                link_dict[link_key] \u003d []"},{"line_number":491,"context_line":"            link_dict[link_key].append({\u0027rel\u0027: link.get(\u0027rel\u0027),"},{"line_number":492,"context_line":"                                        \u0027href\u0027: link.get(\u0027href\u0027)})"},{"line_number":493,"context_line":"            node.remove(link)"},{"line_number":494,"context_line":"        return link_dict"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"    def _from_xml(self, datastring):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuVo%3D","line":493,"updated":"2013-02-20 19:22:35.000000000","message":"Are we removing the link from the node data structure in order to avoid they\u0027re processed by from_xml_node?\n\nIt this reason (and also if this is not the reason), we should explain with a comment.\n\nFrom my tests it seems that if we remove it, then pagination apparently is not performed at all.","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":490,"context_line":"                link_dict[link_key] \u003d []"},{"line_number":491,"context_line":"            link_dict[link_key].append({\u0027rel\u0027: link.get(\u0027rel\u0027),"},{"line_number":492,"context_line":"                                        \u0027href\u0027: link.get(\u0027href\u0027)})"},{"line_number":493,"context_line":"            node.remove(link)"},{"line_number":494,"context_line":"        return link_dict"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"    def _from_xml(self, datastring):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtCg%3D","line":493,"in_reply_to":"AAAAM3%2F%2BuVo%3D","updated":"2013-02-21 04:23:30.000000000","message":"Because _from_xml_node will process link node as empty item.\nI will add comment at here. \n\nAdding link node process for XMLDeserializer just for our testcase. our testcase use XMLDeserializer get the result as dict, then check the dict value.","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":503,"context_line":"            links \u003d self._get_links(root_tag, node)"},{"line_number":504,"context_line":"            result \u003d self._from_xml_node(node, plurals)"},{"line_number":505,"context_line":"            if root_tag \u003d\u003d constants.VIRTUAL_ROOT_KEY:"},{"line_number":506,"context_line":"                return result"},{"line_number":507,"context_line":"            else:"},{"line_number":508,"context_line":"                if links:"},{"line_number":509,"context_line":"                    links.update({root_tag: result})"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuVA%3D","line":506,"updated":"2013-02-20 19:22:35.000000000","message":"root_tag \u003d constants.VIRTUAL_ROOT_KEY and links is not None is not possible because of the way data are serialized.\n\nA comment stating this might help (without it I\u0027m pretty sure I\u0027ll look at this code in a week time and I\u0027ll think it\u0027s a bug...)","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            links \u003d self._get_links(root_tag, node)"},{"line_number":504,"context_line":"            result \u003d self._from_xml_node(node, plurals)"},{"line_number":505,"context_line":"            if root_tag \u003d\u003d constants.VIRTUAL_ROOT_KEY:"},{"line_number":506,"context_line":"                return result"},{"line_number":507,"context_line":"            else:"},{"line_number":508,"context_line":"                if links:"},{"line_number":509,"context_line":"                    links.update({root_tag: result})"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtCI%3D","line":506,"in_reply_to":"AAAAM3%2F%2BuVA%3D","updated":"2013-02-21 04:23:30.000000000","message":":)hehe, I will add comment, thanks","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"4561ea439f138c2c7313d0347f572daa541830f1","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                    links.update({root_tag: result})"},{"line_number":510,"context_line":"                    return links"},{"line_number":511,"context_line":"                else:"},{"line_number":512,"context_line":"                    return {root_tag: result}"},{"line_number":513,"context_line":"        except Exception as e:"},{"line_number":514,"context_line":"            parseError \u003d False"},{"line_number":515,"context_line":"            # Python2.7"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BufI%3D","line":512,"updated":"2013-02-20 17:24:27.000000000","message":"probably more clear to the reader as:\n\nlinks \u003d self._get_links(root_tag, node) or {} \n\nwith \n\nreturn links.update({root_tag: result}) \n\nthough I guess that may be slightly less efficient.  I\u0027m fine either way.","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0d15c046918c983ece3e48728bd2cc3ae079936e","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                    links.update({root_tag: result})"},{"line_number":510,"context_line":"                    return links"},{"line_number":511,"context_line":"                else:"},{"line_number":512,"context_line":"                    return {root_tag: result}"},{"line_number":513,"context_line":"        except Exception as e:"},{"line_number":514,"context_line":"            parseError \u003d False"},{"line_number":515,"context_line":"            # Python2.7"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BtAI%3D","line":512,"in_reply_to":"AAAAM3%2F%2BuG8%3D","updated":"2013-02-21 04:23:30.000000000","message":"I use Salvatore suggest. and change the _get_links return value as \u0027return link_list and {link_key: link_list} or {}\u0027","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":509,"context_line":"                    links.update({root_tag: result})"},{"line_number":510,"context_line":"                    return links"},{"line_number":511,"context_line":"                else:"},{"line_number":512,"context_line":"                    return {root_tag: result}"},{"line_number":513,"context_line":"        except Exception as e:"},{"line_number":514,"context_line":"            parseError \u003d False"},{"line_number":515,"context_line":"            # Python2.7"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BuG8%3D","line":512,"in_reply_to":"AAAAM3%2F%2BufI%3D","updated":"2013-02-20 19:22:35.000000000","message":"I would suggest something along the lines of what Dan proposed (feel free to do as you wish however)\n\nif root_tag \u003d\u003d constants.VIRTUAL_ROOT_KEY:\n     return result\nreturn dict({root_tag: result}, **(links or {}))","commit_id":"87469dd1950394aafc3df512a7d21b581a096e76"}]}
