(self,depth=0)
return me + ''.join(children)
Pretty print this Node and its contents
Pretty print this Node and its contents
Pretty print this Node and its contents
def pretty(self,depth=0):
        'Pretty print this Node and its contents'
        tab = '  '*depth


        me = "%s%s (%d entries) (%d subnodes)\n"%\
            (tab,self.name(),len(self.entries),len(self.nodes))

        children=[]
        for e in self.entries:
            s = "%s%s(%s: %s)\n"%(tab,tab,e.title,e.username)
            children.append(s)
            continue

        for n in self.nodes:
            children.append(n.pretty(depth+1))
            continue

        return me + ''.join(children)
def pretty ( self , depth = 0 ) : tab = '  ' * depth me = "%s%s (%d entries) (%d subnodes)\n" % ( tab , self . name ( ) , len ( self . entries ) , len ( self . nodes ) ) children = [ ] for e in self . entries : s = "%s%s(%s: %s)\n" % ( tab , tab , e . title , e . username ) children . append ( s ) continue for n in self . nodes : children . append ( n . pretty ( depth + 1 ) ) continue return me + '' . join ( children )