예제 #1
0
 def __init__(self, bot, options):
     # Hook the base plugin
     BasePlugin.__init__(self, bot, options)
     # Control output
     self.output = True
     # Initialize variables
     self.resetdata()
예제 #2
0
 def __init__(self, bot, options):
     # Hook the base plugin
     BasePlugin.__init__(self, bot, options)
     # Control output
     self.output = True
     # Initialize variables
     self.resetdata()
예제 #3
0
파일: Auth.py 프로젝트: Laogeodritt/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
     try:
         if options["authtype"] == "nickserv":
             self.authtype = "nickserv"
         else:
             self.authtype = "pygbot"
     except:
         self.authtype = "pygbot"
예제 #4
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
     try:
         if options["authtype"] == "nickserv":
             self.authtype = "nickserv"
         else:
             self.authtype = "pygbot"
     except:
         self.authtype = "pygbot"
예제 #5
0
파일: Log2channel.py 프로젝트: Dritz/pyGBot
    def __init__(self, bot, options):
        BasePlugin.__init__(self, bot, options)

        # Get channel
        try:
            if options['channel'][0] not in CHANNEL_PREFIXES:
                self.channel = '#' + options['channel']
            else:
                self.channel = options['channel']
        except KeyError, IndexError:
            self.channel = None
            log.logger.error("Log2channel: No log channel specified")
예제 #6
0
파일: Commands.py 프로젝트: hastur42/pyGBot
    def __init__(self, bot, options):
        BasePlugin.__init__(self, bot, options)
        if self.bot.plugins.has_key('system.Auth') == False:
            raise StandardError('Unable to load Auth plugin. Please ensure it is loaded first.')

        if options.has_key('_prefix'):
            self.cmdprefix = options['_prefix']
        else:
            self.cmdprefix = '^'
        self.commands = {}
        
        for friendlyname, commandname in options.iteritems():
            if not friendlyname.startswith('_'):
                log.logger.info("Importing command " + commandname + " with friendly name " + friendlyname)
                command = __import__("pyGBot.Plugins.system.CommandSpec." + commandname, fromlist = [commandname])
                self.commands[friendlyname] = getattr(command, commandname)
예제 #7
0
파일: Wiki.py 프로젝트: Dritz/pyGBot
    def __init__(self, bot, options):
        BasePlugin.__init__(self, bot, options)

        # default options
        self.useShortUrl    = False
        self.maxMessageSize = 510
        self.wikiName       = 'Wikipedia'
        self.wikiUrl        = 'http://en.wikipedia.org'
        self.wikiApi        = '/w/api.php'
        self.wikiBase       = '/wiki'
        self.wikiSave       =  {} # settings push/pop from here

        # private attributes
        self.active = False
        self.lastResponse = {}
        self.lastTitle = u""

        # retrieve options from configuration
        if 'shortUrl' in options:
            self.useShortUrl = (options['shortUrl'][0].upper()!='F')
        if 'maxMessageSize' in options:
            self.maxMessageSize = min(self.maxMessageSize,
                                      int(options['maxMessageSize']))
        if 'wikiName' in options:
            self.wikiName = options['wikiName'].strip()
        if 'wikiUrl' in options:
            self.wikiUrl = options['wikiUrl'].rstrip('/\\?')
        if 'wikiApi' in options:
            if options['wikiApi'][0] != '/':
                self.wikiApi = '/' + options['wikiApi'].rstrip('/\\?')
            else:
                self.wikiApi = options['wikiApi'].rstrip('/\\?')
        if 'wikiBase' in options:
            if options['wikiBase'][0] != '/':
                self.wikiBase = '/' + options['wikiBase'].rstrip('/\\?')
            else:
                self.wikiBase = options['wikiBase'].rstrip('/\\?')
예제 #8
0
파일: Uno.py 프로젝트: Dritz/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.game_running = False
예제 #9
0
파일: Poker.py 프로젝트: chaos95/fluxxbot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.tourney = []
예제 #10
0
파일: Poker.py 프로젝트: hastur42/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.tourney = []
예제 #11
0
파일: Auth.py 프로젝트: chaos95/fluxxbot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
예제 #12
0
파일: Uno.py 프로젝트: hastur42/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.game_running = False
예제 #13
0
파일: Startup.py 프로젝트: hastur42/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.plugins = options.keys()
예제 #14
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
     self.modbreak = re.compile('([\+\-\*\/%^].*)')
예제 #15
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
예제 #16
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
예제 #17
0
파일: Decide.py 프로젝트: chaos95/fluxxbot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
예제 #18
0
파일: Fluxx.py 프로젝트: magcius/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.options = options
     self.users = {}
     self.user_handlers = {}
예제 #19
0
파일: Roll.py 프로젝트: ducttapeDj/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
     self.modbreak = re.compile('([\+\-\*\/%^].*)')
예제 #20
0
파일: Startup.py 프로젝트: Dritz/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.plugins = options.keys()
예제 #21
0
파일: Werewolf.py 프로젝트: hastur42/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.output = True
     self.moderation = True
예제 #22
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.options = options
     self.users = {}
     self.user_handlers = {}
예제 #23
0
파일: Werewolf.py 프로젝트: Dritz/pyGBot
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.output = True
     self.moderation = True