diff options
| author | 2019-06-04 17:51:20 +0100 | |
|---|---|---|
| committer | 2019-06-04 17:51:20 +0100 | |
| commit | 8dbae6a5e93bd97a27552fbb5890c0919c592788 (patch) | |
| tree | d605cb9bb0a8b042081debc2ae15b0de92483ad0 /src/IRCLine.py | |
| parent | `.on_send(` only exists on SentLines, not ParsedLines (diff) | |
| signature | ||
Give SentLine (and preproc.send events) a new event object, to track events
related to a line after it is sent
Diffstat (limited to 'src/IRCLine.py')
| -rw-r--r-- | src/IRCLine.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/IRCLine.py b/src/IRCLine.py index 53f328b8..2a52bf23 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -85,13 +85,13 @@ class ParsedLine(object): return " ".join(pieces).split("\n")[0].strip("\r") class SentLine(IRCObject.Object): - def __init__(self, send_time: datetime.datetime, hostmask: str, - line: ParsedLine): + def __init__(self, events: "EventManager.EventHook", + send_time: datetime.datetime, hostmask: str, line: ParsedLine): + self.events = events self.send_time = send_time self._hostmask = hostmask self.parsed_line = line - self._on_send: typing.List[typing.Callable[[], None]] = [] self.truncate_marker: typing.Optional[str] = None def __repr__(self) -> str: @@ -135,9 +135,3 @@ class SentLine(IRCObject.Object): return self._for_wire().decode("utf8") def truncated(self) -> str: return self._encode_truncate()[1] - - def on_send(self, func: typing.Callable[[], None]): - self._on_send.append(func) - def sent(self): - for func in self._on_send[:]: - func() |
