(self, node=None, level=0)
return res
String representation of tree for debug purposees
String representation of tree for debug purposees
String representation of tree for debug purposees
def print_tree(self, node=None, level=0):
        """String representation of tree for debug purposees"""
        if node is None:
            node = self.root
        res = ""
        for child in node.children:
            res += ("{:>20} {}{} {}\n".format(
                str(child.value), "    " * level, node.attr.name,
                child.description))
            res += self.print_tree(child, level + 1)
        return res
def print_tree ( self , node = None , level = 0 ) : if node is None : node = self . root res = "" for child in node . children : res += ( "{:>20} {}{} {}\n" . format ( str ( child . value ) , "    " * level , node . attr . name , child . description ) ) res += self . print_tree ( child , level + 1 ) return res