mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
classes: split up run() into run() and runline()
This helps the debugging process, by allowing us to also inject lines directly into the protocol module.
This commit is contained in:
parent
c77f92357a
commit
19c4c2ce3f
@ -207,8 +207,11 @@ class Irc():
|
|||||||
line = line.strip(b'\r')
|
line = line.strip(b'\r')
|
||||||
# FIXME: respect other encodings?
|
# FIXME: respect other encodings?
|
||||||
line = line.decode("utf-8", "replace")
|
line = line.decode("utf-8", "replace")
|
||||||
|
self.runline(line)
|
||||||
|
|
||||||
|
def runline(self, line):
|
||||||
|
"""Sends a command to the protocol module."""
|
||||||
log.debug("(%s) <- %s", self.name, line)
|
log.debug("(%s) <- %s", self.name, line)
|
||||||
hook_args = None
|
|
||||||
try:
|
try:
|
||||||
hook_args = self.proto.handle_events(line)
|
hook_args = self.proto.handle_events(line)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user