INNER CODE UNIT · Python

pprint

KATRIN-Experiment/Kassiopeia · Scripts/gen-bindings-docs.py:64

    def pprint(self, level=0, stack=[], key=''):
        indent = level*'  '
        if not key and self.xml_names:
            key = list(self.xml_names)[0]

        #print(indent + f"{key} = {self.name}")  #  ({self.source_file})
        for attr_key in sorted(self.attributes.keys()):
            attr = self.attributes[attr_key]
            print(indent + f"{attr_key} = {attr.name}")

        for node_key in sorted(self.children.keys()):
            node = self.children[node_key]
            full_name = f'"{node.name}__{node_key}'
            if not full_name in stack:
                stack.append(full_name)
                print(indent + f"{node_key} = {node.name}")  #  ({self.source_file})
                node.pprint(level+1, stack, key=node_key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…