Move definition of IRCArgs above IRCLine

This commit is contained in:
jesopo 2018-11-04 17:03:01 +00:00
parent e1d261bda0
commit 52aa8a51a6

View file

@ -52,14 +52,6 @@ def seperate_hostmask(hostmask: str) -> IRCHostmask:
username, _, hostname = username.partition("@")
return IRCHostmask(nickname, username, hostname, hostmask)
class IRCLine(object):
def __init__(self, tags: dict, prefix: typing.Optional[str], command: str,
args: IRCArgs):
self.tags = tags
self.prefix = prefix
self.command = command
self.args = args
class IRCArgs(object):
def __init__(self, args: typing.List[str]):
self._args = args
@ -70,6 +62,14 @@ class IRCArgs(object):
return self._args[index]
return None
class IRCLine(object):
def __init__(self, tags: dict, prefix: typing.Optional[str], command: str,
args: IRCArgs):
self.tags = tags
self.prefix = prefix
self.command = command
self.args = args
def parse_line(line: str) -> IRCLine:
tags = {}
prefix = typing.Optional[IRCHostmask]