(self, widget, pad)
Insert the number of each terminal in a group, into that terminal
Insert the number of each terminal in a group, into that terminal
Insert the number of each terminal in a group into that terminal
def do_enumerate(self, widget, pad):
        """Insert the number of each terminal in a group, into that terminal"""
        if pad:
            numstr = '%0'+str(len(str(len(self.terminals))))+'d'
        else:
            numstr = '%d'

        terminals = []
        for window in self.windows:
            containers, win_terminals = enumerate_descendants(window)
            terminals.extend(win_terminals)

        for term in self.get_target_terms(widget):
            idx = terminals.index(term)
            term.feed(numstr.encode() % (idx + 1))
def do_enumerate ( self , widget , pad ) : if pad : numstr = '%0' + str ( len ( str ( len ( self . terminals ) ) ) ) + 'd' else : numstr = '%d' terminals = [ ] for window in self . windows : containers , win_terminals = enumerate_descendants ( window ) terminals . extend ( win_terminals ) for term in self . get_target_terms ( widget ) : idx = terminals . index ( term ) term . feed ( numstr . encode ( ) % ( idx + 1 ) )