From 51cac7d9b5a97e6cafd4c24e920bce968edbc95c Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 18 Jun 2019 15:18:44 +0100 Subject: [PATCH] add has_tag() and get_tag() to IRCLine.ParsedLine --- src/IRCLine.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/IRCLine.py b/src/IRCLine.py index 666977f9..9b028a17 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -66,6 +66,10 @@ class ParsedLine(object): def add_tag(self, tag: str, value: str=None): self.tags[tag] = value or "" + def has_tag(self, tag: str) -> bool: + return "tag" in self.tags + def get_tag(self, tag: str) -> typing.Optional[str]: + return self.tags[tag] def _tag_str(self, tags: typing.Dict[str, str]) -> str: tag_pieces = []