Ejemplo n.º 1
0
    def process_events(self, conn, event):
        try:
            network = self.connections[conn]

            if event.eventtype() != 'all_raw_messages':
                network.notify(event)

        except Exception as e:
            log.exception('exception during dispatch: {0}'.format(e))
Ejemplo n.º 2
0
    def process_commands(self):
        while self.running:
            try:
                command, network, params = self.next_command(block=True)
                log.info('processing command {0} from {1} with parameters {2}'.format(command, network, params))

                method = 'command_' + command
                if hasattr(self, method):
                    getattr(self, method)(network, params)
                else:
                    log.warning('method {0} not found, command discarded'.format(method))

            except Exception as e:
                log.exception('exception processing command: {0}'.format(e))
Ejemplo n.º 3
0
 def process_irc(self):
     while self.running:
         try:
             self.irc.process_once(timeout=1)
         except Exception as e:
             log.exception('exception in process_irc: {0}'.format(e))