コード例 #1
0
ファイル: pickup.py プロジェクト: unknownnf/pypickbot
    def __init__(self, bot):
        """Plugin init

        Reads games from config"""
        self.games = {}
        self.order = []
        self.last_promote = 0
        if not config.has_section('Pickup games'):
            log.err('Could not find section "Pickup games" of the config!')
            return
        games = config.items('Pickup games')
#        log.msg(games)

        for (gamenick, gamename) in games:
            if gamenick == 'order':
                self.order = config.getlist('Pickup games', 'order')
            else:
                if config.has_section('Pickup: '+gamenick):
                    gamesettings = dict(config.items('Pickup: '+gamenick))
                else:
                    gamesettings = {}
                self.games[gamenick] = Game(
                    self,
                    gamenick, gamename,
                    **gamesettings)
                if gamenick not in self.order:
                    self.order.append(gamenick)

        self.order = filter(lambda x: x in self.games, self.order)
コード例 #2
0
ファイル: pickup.py プロジェクト: unknownnf/pypickbot
 def __init__(self, pickup, nick, name, captains=2, players=8, autopick=False, **kwargs):
     self.pickup = pickup
     self.nick = nick
     self.name = name
     self.caps = int(captains)
     self.maxplayers = int(players)
     self.autopick = bool(autopick)
     self.info = kwargs
     self.players = []
     self.starting = False
     self.abort_start = False
     
     if 'teamnames' in kwargs:
         self.teamnames = config.getlist('Pickup: '+nick, 'teamnames')
     else:
         self.teamnames = []
コード例 #3
0
ファイル: modable.py プロジェクト: unknownnf/pypickbot
 def load_modules(self):
     """Loads modules set in the config"""
     log.msg(_("Loading enabled modules..."))
     self.load(config.getlist('Modules', 'modules'))
コード例 #4
0
ファイル: modable.py プロジェクト: unknownnf/pypickbot
 def load_modules_config(self):
     """Load modules' defaults"""
     log.msg(_("Loading default module configs..."))
     self.load_module_config(config.getlist('Modules', 'modules'))
コード例 #5
0
ファイル: irc.py プロジェクト: unknownnf/pypickbot
 def __init__(self):
     self.channels = config.getlist('Server', 'channels')
     self.nickname = config.get('Bot', 'nickname')