Example #1
0
 def check(_):
     if self._pending:
         log.debug("Waiting on %d plugin commands" % len(self._pending))
         d = defer.DeferredList(self._pending, consumeErrors=True)
         d.addBoth(check)
         return d
     else:
         log.trace("All plugin commands complete")
Example #2
0
 def check(_):
     if self._pending:
         log.debug("Waiting on %d plugin commands" % len(self._pending))
         d = defer.DeferredList(self._pending, consumeErrors=True)
         d.addBoth(check)
         return d
     else:
         log.trace("All plugin commands complete")
Example #3
0
    def hook(self, conn, event):
        log.trace("event: %s" % str(event))

        for func in self.hooks[event['type']]:
            try:
                d = func(conn, event.copy())
            except:
                log.error(failure.Failure())
            else:
                self._add_pending(d)
Example #4
0
    def hook(self, conn, event):
        log.trace("event: %s" % str(event))

        for func in self.hooks[event['type']]:
            try:
                d = func(conn, event.copy())
            except:
                log.error(failure.Failure())
            else:
                self._add_pending(d)
Example #5
0
    def command(self, conn, event):
        log.trace("command: %s: %s" % (event['command'], event['text']))

        if event['command'] in self.commands:
            try:
                d = self.commands[event['command']](conn, event.copy())
            except:
                log.error(failure.Failure())
            else:
                self._add_pending(d)
        else:
            self.hook(conn, event)
Example #6
0
    def command(self, conn, event):
        log.trace("command: %s: %s" % (event['command'], event['text']))

        if event['command'] in self.commands:
            try:
                d = self.commands[event['command']](conn, event.copy())
            except:
                log.error(failure.Failure())
            else:
                self._add_pending(d)
        else:
            self.hook(conn, event)
Example #7
0
    def _load(self):
        """Load all available plugins"""

        self.plugins = getPlugins(IHackabotPlugin, plugins)
        self.commands = {}
        self.hooks = {}

        for hook in self.hook_types:
            self.hooks[hook] = []

        for plugin in self.plugins:
            log.trace("Found plugin: %s" % plugin)
            for attr in dir(plugin):
                if attr[0] == '_':
                    continue
                log.trace("Found plugin attr: %s" % attr)
                self._check_attr(plugin, attr)
Example #8
0
    def _load(self):
        """Load all available plugins"""

        self.plugins = getPlugins(IHackabotPlugin, plugins)
        self.commands = {}
        self.hooks = {}

        for hook in self.hook_types:
            self.hooks[hook] = []

        for plugin in self.plugins:
            log.trace("Found plugin: %s" % plugin)
            for attr in dir(plugin):
                if attr[0] == '_':
                    continue
                log.trace("Found plugin attr: %s" % attr)
                self._check_attr(plugin, attr)
Example #9
0
 def sendLine(self, line):
     if line.startswith("error"):
         log.warn(line, prefix=self._pid)
     else:
         log.trace(line, prefix=self._pid)
Example #10
0
 def outReceived(self, data):
     log.trace(data.strip(), prefix=self._pid)
     self.dataReceived(data)
Example #11
0
 def irc_unknown(self, prefix, command, params):
     log.trace("unknown: %s %s %s" % (prefix, command, params))
Example #12
0
 def sendLine(self, line):
     if line.startswith("error"):
         log.warn(line, prefix=self._pid)
     else:
         log.trace(line, prefix=self._pid)
Example #13
0
 def outReceived(self, data):
     log.trace(data.strip(), prefix=self._pid)
     self.dataReceived(data)
Example #14
0
 def irc_unknown(self, prefix, command, params):
     log.trace("unknown: %s %s %s" % (prefix, command, params))