(self)
Create a new group
Create a new group
Create a new group
def create_group(self):
        """Create a new group"""
        if self.terminal.group:
            self.groupentry.set_text(self.terminal.group)
        else:
            defaultmembers=[_('Alpha'),_('Beta'),_('Gamma'),_('Delta'),_('Epsilon'),_('Zeta'),_('Eta'),
                            _('Theta'),_('Iota'),_('Kappa'),_('Lambda'),_('Mu'),_('Nu'),_('Xi'),
                            _('Omicron'),_('Pi'),_('Rho'),_('Sigma'),_('Tau'),_('Upsilon'),_('Phi'),
                            _('Chi'),_('Psi'),_('Omega')]
            currentgroups=set(self.terminator.groups)
            for i in range(1,4):
                defaultgroups=set(map(''.join, list(itertools.product(defaultmembers,repeat=i))))
                freegroups = list(defaultgroups-currentgroups)
                if freegroups:
                    self.groupentry.set_text(random.choice(freegroups))
                    break
            else:
                self.groupentry.set_text('')
        self.groupentry.show()
        self.grouplabel.hide()
        self.groupentry.grab_focus()
        self.update_visibility()
def create_group ( self ) : if self . terminal . group : self . groupentry . set_text ( self . terminal . group ) else : defaultmembers = [ _ ( 'Alpha' ) , _ ( 'Beta' ) , _ ( 'Gamma' ) , _ ( 'Delta' ) , _ ( 'Epsilon' ) , _ ( 'Zeta' ) , _ ( 'Eta' ) , _ ( 'Theta' ) , _ ( 'Iota' ) , _ ( 'Kappa' ) , _ ( 'Lambda' ) , _ ( 'Mu' ) , _ ( 'Nu' ) , _ ( 'Xi' ) , _ ( 'Omicron' ) , _ ( 'Pi' ) , _ ( 'Rho' ) , _ ( 'Sigma' ) , _ ( 'Tau' ) , _ ( 'Upsilon' ) , _ ( 'Phi' ) , _ ( 'Chi' ) , _ ( 'Psi' ) , _ ( 'Omega' ) ] currentgroups = set ( self . terminator . groups ) for i in range ( 1 , 4 ) : defaultgroups = set ( map ( '' . join , list ( itertools . product ( defaultmembers , repeat = i ) ) ) ) freegroups = list ( defaultgroups - currentgroups ) if freegroups : self . groupentry . set_text ( random . choice ( freegroups ) ) break else : self . groupentry . set_text ( '' ) self . groupentry . show ( ) self . grouplabel . hide ( ) self . groupentry . grab_focus ( ) self . update_visibility ( )