(parent)
return(containers, terminals)
Walk all our children and build up a list of containers and
    terminals
Walk all our children and build up a list of containers and
    terminals
Walk all our children and build up a list of containers and terminals
def enumerate_descendants(parent):
    """Walk all our children and build up a list of containers and
    terminals"""
    # FIXME: Does having to import this here mean we should move this function
    # back to Container?
    from .factory import Factory

    containerstmp = []
    containers = []
    terminals = []
    maker = Factory()

    if parent is None:
        err('no parent widget specified')
        return

    for descendant in parent.get_children():
        if maker.isinstance(descendant, 'Container'):
            containerstmp.append(descendant)
        elif maker.isinstance(descendant, 'Terminal'):
            terminals.append(descendant)

        while len(containerstmp) > 0:
            child = containerstmp.pop(0)
            for descendant in child.get_children():
                if maker.isinstance(descendant, 'Container'):
                    containerstmp.append(descendant)
                elif maker.isinstance(descendant, 'Terminal'):
                    terminals.append(descendant)
            containers.append(child)

    dbg('%d containers and %d terminals fall beneath %s' % (len(containers), 
        len(terminals), parent))
    return(containers, terminals)
def enumerate_descendants ( parent ) : # FIXME: Does having to import this here mean we should move this function # back to Container? from . factory import Factory containerstmp = [ ] containers = [ ] terminals = [ ] maker = Factory ( ) if parent is None : err ( 'no parent widget specified' ) return for descendant in parent . get_children ( ) : if maker . isinstance ( descendant , 'Container' ) : containerstmp . append ( descendant ) elif maker . isinstance ( descendant , 'Terminal' ) : terminals . append ( descendant ) while len ( containerstmp ) > 0 : child = containerstmp . pop ( 0 ) for descendant in child . get_children ( ) : if maker . isinstance ( descendant , 'Container' ) : containerstmp . append ( descendant ) elif maker . isinstance ( descendant , 'Terminal' ) : terminals . append ( descendant ) containers . append ( child ) dbg ( '%d containers and %d terminals fall beneath %s' % ( len ( containers ) , len ( terminals ) , parent ) ) return ( containers , terminals )