

def _dump_item(self, item, indent=''):
    if isBadItem(item):
        return
    v = item.value
    if v.vsHasField('children'):
        (yield '{indent:s}<{tag:s}>'.format(indent=indent, tag=getTagName(item.header)))
        for (_, c) in v.children:
            if isBadItem(c):
                continue
            for l in self._dump_item(c, (indent + '  ')):
                (yield l)
        (yield '{indent:s}</{tag:s}>'.format(indent=indent, tag=getTagName(item.header)))
    else:
        (yield "{indent:s}<{tag:s} type='{type_:s}'>{data:s}</{tag:s}>".format(indent=indent, type_=formatValueType(item), data=self._formatValue(item), tag=getTagName(item.header)))

dataset/ETHPy150Open williballenthin/python-sdb/scripts/sdb_dump_database.py SdbDatabaseDumper._dump_item/original