(self)
Clean out unused groups
Clean out unused groups
Clean out unused groups
def group_hoover(self):
        """Clean out unused groups"""

        if self.config['autoclean_groups']:
            inuse = []
            todestroy = []

            for terminal in self.terminals:
                if terminal.group:
                    if not terminal.group in inuse:
                        inuse.append(terminal.group)

            for group in self.groups:
                if not group in inuse:
                    todestroy.append(group)

            dbg('Terminator::group_hoover: %d groups, hoovering %d' %
                    (len(self.groups), len(todestroy)))
            for group in todestroy:
                self.groups.remove(group)
def group_hoover ( self ) : if self . config [ 'autoclean_groups' ] : inuse = [ ] todestroy = [ ] for terminal in self . terminals : if terminal . group : if not terminal . group in inuse : inuse . append ( terminal . group ) for group in self . groups : if not group in inuse : todestroy . append ( group ) dbg ( 'Terminator::group_hoover: %d groups, hoovering %d' % ( len ( self . groups ) , len ( todestroy ) ) ) for group in todestroy : self . groups . remove ( group )