(self, tree, modname, parent=None, prefix='')
return result
Render in text a class tree as returned by inspect.getclasstree().
Render in text a class tree as returned by inspect.getclasstree().
Render in text a class tree as returned by inspect . getclasstree () .
def formattree(self, tree, modname, parent=None, prefix=''):
        """Render in text a class tree as returned by inspect.getclasstree()."""
        result = ''
        for entry in tree:
            if type(entry) is type(()):
                c, bases = entry
                result = result + prefix + classname(c, modname)
                if bases and bases != (parent,):
                    parents = (classname(c, modname) for c in bases)
                    result = result + '(%s)' % ', '.join(parents)
                result = result + '\n'
            elif type(entry) is type([]):
                result = result + self.formattree(
                    entry, modname, c, prefix + '    ')
        return result
def formattree ( self , tree , modname , parent = None , prefix = '' ) : result = '' for entry in tree : if type ( entry ) is type ( ( ) ) : c , bases = entry result = result + prefix + classname ( c , modname ) if bases and bases != ( parent , ) : parents = ( classname ( c , modname ) for c in bases ) result = result + '(%s)' % ', ' . join ( parents ) result = result + '\n' elif type ( entry ) is type ( [ ] ) : result = result + self . formattree ( entry , modname , c , prefix + '    ' ) return result