Skip to content
Snippets Groups Projects
Commit 53d49e50 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Now the traverse()-function of LocalBackend also outputs the section indices.

parent af1d3282
No related branches found
No related tags found
No related merge requests found
......@@ -319,15 +319,15 @@ class Results(object):
"""A generator function for traversing the data in the parser results.
"""
for name, sections in section_map.items():
for section in sections:
yield (name, ParserEvent.open_section, None)
for name, value in section.simpleValues.items():
yield (name, ParserEvent.add_value, value)
for name, value in section.arrayValues.items():
yield (name, ParserEvent.add_array_value, value)
for i_section, section in enumerate(sections):
yield (name, ParserEvent.open_section, i_section)
for value_name, value_value in section.simpleValues.items():
yield (value_name, ParserEvent.add_value, value_value)
for array_name, array_value in section.arrayValues.items():
yield (array_name, ParserEvent.add_array_value, array_value)
for x in self.traverse_recursive(section.subSectionValues):
yield x
yield (name, ParserEvent.close_section, None)
yield (name, ParserEvent.close_section, i_section)
def print_summary(self):
"""Return a string representing the data contained in the results. This
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment