IRCServer.alias is no longer optional
This commit is contained in:
parent
e3100bb64a
commit
032f6fbc3b
2 changed files with 3 additions and 7 deletions
|
@ -10,7 +10,7 @@ class Server(IRCObject.Object):
|
||||||
bot: "IRCBot.Bot",
|
bot: "IRCBot.Bot",
|
||||||
events: EventManager.EventHook,
|
events: EventManager.EventHook,
|
||||||
id: int,
|
id: int,
|
||||||
alias: typing.Optional[str],
|
alias: str,
|
||||||
connection_params: utils.irc.IRCConnectionParameters):
|
connection_params: utils.irc.IRCConnectionParameters):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.events = events
|
self.events = events
|
||||||
|
@ -67,11 +67,7 @@ class Server(IRCObject.Object):
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return "IRCServer.Server(%s)" % self.__str__()
|
return "IRCServer.Server(%s)" % self.__str__()
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
if self.alias:
|
|
||||||
return self.alias
|
return self.alias
|
||||||
return "%s:%s%s" % (self.connection_params.hostname,
|
|
||||||
"+" if self.connection_params.tls else "",
|
|
||||||
self.connection_params.port)
|
|
||||||
|
|
||||||
def fileno(self) -> int:
|
def fileno(self) -> int:
|
||||||
return self.socket.fileno()
|
return self.socket.fileno()
|
||||||
|
|
|
@ -225,7 +225,7 @@ def parse_format(s: str) -> str:
|
||||||
|
|
||||||
OPT_STR = typing.Optional[str]
|
OPT_STR = typing.Optional[str]
|
||||||
class IRCConnectionParameters(object):
|
class IRCConnectionParameters(object):
|
||||||
def __init__(self, id: int, alias: OPT_STR, hostname: str, port: int,
|
def __init__(self, id: int, alias: str, hostname: str, port: int,
|
||||||
password: OPT_STR, tls: bool, ipv4: bool, bindhost: OPT_STR,
|
password: OPT_STR, tls: bool, ipv4: bool, bindhost: OPT_STR,
|
||||||
nickname: str, username: OPT_STR, realname: OPT_STR,
|
nickname: str, username: OPT_STR, realname: OPT_STR,
|
||||||
args: typing.Dict[str, str]={}):
|
args: typing.Dict[str, str]={}):
|
||||||
|
|
Loading…
Reference in a new issue