From 6c5dc958d037907d98dd6edbc4e37f5ac39768ac Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 10 Jun 2019 10:45:02 +0100 Subject: Add `.assure()` to ParsedLine, to make it immune from `.valid()` --- src/IRCLine.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/IRCLine.py') diff --git a/src/IRCLine.py b/src/IRCLine.py index 9e1d85fb..c0263d20 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -47,6 +47,7 @@ class ParsedLine(object): self.source = source self.tags = {} if tags == None else tags self._valid = True + self._assured = False def __repr__(self): return "ParsedLine(%s)" % self.__str__() @@ -58,6 +59,11 @@ class ParsedLine(object): def invalidate(self): self._valid = False + def assured(self) -> bool: + return self._assured + def assure(self): + self._assured = True + def _tag_str(self, tags: typing.Dict[str, str]) -> str: tag_pieces = [] for tag, value in tags.items(): -- cgit v1.3.1-10-gc9f91