예제 #1
0
파일: plugin.py 프로젝트: affix/Fedbot
 def __init__(self, irc):
     self.__parent = super(FloodProtect, self)
     self.__parent.__init__(irc)
     self.queueKick = ircutils.FloodQueue(
         self.registryValue('lifeQueueKick'))
     self.queueBan = ircutils.FloodQueue(self.registryValue('lifeQueueBan'))
     self.queueLongBan = ircutils.FloodQueue(
         self.registryValue('lifeQueueLongBan'))
예제 #2
0
 def __init__(self, irc):
     self.__parent = super(Ctcp, self)
     self.__parent.__init__(irc)
     self.ignores = ircutils.IrcDict()
     self.floods = ircutils.FloodQueue(conf.supybot.abuse.flood.interval())
     conf.supybot.abuse.flood.interval.addCallback(
         self.setFloodQueueTimeout)
예제 #3
0
 def __init__(self, irc):
     self.__parent = super(Misc, self)
     self.__parent.__init__(irc)
     self.invalidCommands = \
             ircutils.FloodQueue(conf.supybot.abuse.flood.interval())
     conf.supybot.abuse.flood.interval.addCallback(
         self.setFloodQueueTimeout)
예제 #4
0
 def __init__(self, irc=None):
     if irc is not None:
         assert not irc.getCallback(self.name())
     self.__parent = super(Owner, self)
     self.__parent.__init__(irc)
     # Setup command flood detection.
     self.commands = ircutils.FloodQueue(
         conf.supybot.abuse.flood.interval())
     conf.supybot.abuse.flood.interval.addCallback(
         self.setFloodQueueTimeout)
     # Setup plugins and default plugins for commands.
     #
     # This needs to be done before we connect to any networks so that the
     # children of supybot.plugins (the actual plugins) exist and can be
     # loaded.
     for (name, s) in registry._cache.items():
         if 'alwaysLoadDefault' in name or 'alwaysLoadImportant' in name:
             continue
         if name.startswith('supybot.plugins'):
             try:
                 (_, _, name) = registry.split(name)
             except ValueError:  # unpack list of wrong size.
                 continue
             # This is just for the prettiness of the configuration file.
             # There are no plugins that are all-lowercase, so we'll at
             # least attempt to capitalize them.
             if name == name.lower():
                 name = name.capitalize()
             conf.registerPlugin(name)
         if name.startswith('supybot.commands.defaultPlugins'):
             try:
                 (_, _, _, name) = registry.split(name)
             except ValueError:  # unpack list of wrong size.
                 continue
             registerDefaultPlugin(name, s)
     # Setup Irc objects, connected to networks.  If world.ircs is already
     # populated, chances are that we're being reloaded, so don't do this.
     if not world.ircs:
         for network in conf.supybot.networks():
             try:
                 self._connect(network)
             except socket.error as e:
                 self.log.error('Could not connect to %s: %s.', network, e)
             except Exception as e:
                 self.log.exception('Exception connecting to %s:', network)
                 self.log.error('Could not connect to %s: %s.', network, e)
예제 #5
0
 def __init__(self, irc):
     self.__parent = super(Misc, self)
     self.__parent.__init__(irc)
     self.invalidCommands = ircutils.FloodQueue(60)
예제 #6
0
파일: plugin.py 프로젝트: Kefkius/mazabot
 def __init__(self, irc):
     self.__parent = super(Ctcp, self)
     self.__parent.__init__(irc)
     self.ignores = ircutils.IrcDict()
     self.floods = ircutils.FloodQueue(60)