aboutsummaryrefslogtreecommitdiff
path: root/src/utils/irc.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-30 17:49:35 +0000
committerGravatar jesopo2018-10-30 17:49:35 +0000
commitb543e31cd2a665b25aab4554e46a0ed5067d1bfe (patch)
tree285e0b52f45e167dbc381951482c7bff660c6630 /src/utils/irc.py
parentTypo in src/Exports; 'self_exports' -> 'self.exports' (diff)
signature
Fix/refactor issues brought up by type hint linting
Diffstat (limited to 'src/utils/irc.py')
-rw-r--r--src/utils/irc.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index 3e7f8b76..b7819e7c 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -53,7 +53,7 @@ def seperate_hostmask(hostmask: str) -> IRCHostmask:
return IRCHostmask(nickname, username, hostname, hostmask)
class IRCLine(object):
- def __init__(self, tags: dict, prefix: str, command: str,
+ def __init__(self, tags: dict, prefix: typing.Optional[str], command: str,
args: typing.List[str], arbitrary: typing.Optional[str],
last: str):
self.tags = tags
@@ -65,7 +65,7 @@ class IRCLine(object):
def parse_line(line: str) -> IRCLine:
tags = {}
- prefix = None
+ prefix = typing.Optional[IRCHostmask]
command = None
if line[0] == "@":
@@ -74,12 +74,12 @@ def parse_line(line: str) -> IRCLine:
tag, _, value = tag.partition("=")
tags[tag] = value
- line, _, arbitrary = line.partition(" :")
- arbitrary = arbitrary or None
+ line, _, arbitrary_split = line.partition(" :")
+ arbitrary = arbitrary_split or None
if line[0] == ":":
- prefix, line = line[1:].split(" ", 1)
- prefix = seperate_hostmask(prefix)
+ prefix_str, line = line[1:].split(" ", 1)
+ prefix = seperate_hostmask(prefix_str)
command, _, line = line.partition(" ")
args = line.split(" ")