MCPcopy Create free account
hub / github.com/ActiveState/code / parse

Method parse

recipes/Python/578138_gprof2dotpy/recipe-578138.py:1768–1784  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1766 XmlParser.__init__(self, stream)
1767
1768 def parse(self):
1769 objects = {}
1770 nodes = {}
1771
1772 self.element_start('profile')
1773 while self.token.type == XML_ELEMENT_START:
1774 if self.token.name_or_data == 'objects':
1775 assert not objects
1776 objects = self.parse_items('objects')
1777 elif self.token.name_or_data == 'nodes':
1778 assert not nodes
1779 nodes = self.parse_items('nodes')
1780 else:
1781 self.parse_value(self.token.name_or_data)
1782 self.element_end('profile')
1783
1784 return self.build_profile(objects, nodes)
1785
1786 def parse_items(self, name):
1787 assert name[-1] == 's'

Callers

nothing calls this directly

Calls 5

parse_itemsMethod · 0.95
parse_valueMethod · 0.95
build_profileMethod · 0.95
element_startMethod · 0.80
element_endMethod · 0.80

Tested by

no test coverage detected