def __init__(self, name, tasclient): super(IPlugin, self).__init__() self.tasclient = tasclient self.name = name self.logger = Log.getPluginLogger(name) self.commands = defaultdict(list) #this registers all cmd_* where * matches an actualLobby command in our command dict foreign_cmd_count = 0 cmd_count = 0 for f in filter( lambda f: f.startswith('cmd_'), dir(self)): try: name_tokens = f.split('_') cmd = name_tokens[1].upper() if len(name_tokens) >= 3 and cmd in CHAT_COMMANDS: self.commands[cmd].append(('!%s'%name_tokens[2],f)) elif cmd in ALL_COMMANDS: self.commands[cmd].append((None,f)) else: self.logger.error('trying to register function for unknown command %s'%cmd) foreign_cmd_count += f != 'cmd_said_help' and f != 'cmd_saidprivate_help' cmd_count += 1 except IndexError,e: self.logger.debug(f) self.logger.exception(e)