Beispiel #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()
Beispiel #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()
Beispiel #3
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"
Beispiel #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"
Beispiel #5
0
    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")
Beispiel #6
0
    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)
Beispiel #7
0
    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('/\\?')
Beispiel #8
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.game_running = False
Beispiel #9
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.tourney = []
Beispiel #10
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.tourney = []
Beispiel #11
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
Beispiel #12
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.game_running = False
Beispiel #13
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.plugins = options.keys()
Beispiel #14
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
     self.modbreak = re.compile('([\+\-\*\/%^].*)')
Beispiel #15
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
Beispiel #16
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.users = {}
     self.conf = ConfigObj("users.ini")
Beispiel #17
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
Beispiel #18
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.options = options
     self.users = {}
     self.user_handlers = {}
Beispiel #19
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.activeGame = False
     self.output = True
     self.modbreak = re.compile('([\+\-\*\/%^].*)')
Beispiel #20
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.plugins = options.keys()
Beispiel #21
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.output = True
     self.moderation = True
Beispiel #22
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.options = options
     self.users = {}
     self.user_handlers = {}
Beispiel #23
0
 def __init__(self, bot, options):
     BasePlugin.__init__(self, bot, options)
     self.output = True
     self.moderation = True