Example #1
0
    def handle(self, data):
        data = Message.parse(line)

        if msg.source is not None:
            msg.source = User(msg.source)
        else:
            msg.source = User(self.host)

        if msg.command in events.keys():
            for event in handlers:
                event(self, msg)
Example #2
0
 def write(self, *args):
     msg = Message.from_args(args)
     self._send(str(msg))