Type annotate ParsedLine.tags, add ParsedLine.add_tag()
This commit is contained in:
parent
5b58cc05b6
commit
055eed24fd
1 changed files with 4 additions and 1 deletions
|
@ -45,7 +45,7 @@ class ParsedLine(object):
|
|||
self._args = args
|
||||
self.args = IRCArgs(args)
|
||||
self.source = source
|
||||
self.tags = {} if tags == None else tags
|
||||
self.tags = tags or {} # type: typing.Dict[str, str]
|
||||
self._valid = True
|
||||
self._assured = False
|
||||
|
||||
|
@ -64,6 +64,9 @@ class ParsedLine(object):
|
|||
def assure(self):
|
||||
self._assured = True
|
||||
|
||||
def add_tag(self, tag: str, value: str=None):
|
||||
self.tags[tag] = value or ""
|
||||
|
||||
def _tag_str(self, tags: typing.Dict[str, str]) -> str:
|
||||
tag_pieces = []
|
||||
for tag, value in tags.items():
|
||||
|
|
Loading…
Reference in a new issue