change IRCServer.Server.__str__ to return hostname:port instead of full __repr__

This commit is contained in:
jesopo 2018-08-28 16:05:43 +01:00
parent 5602b95d70
commit 2728a8422f

View file

@ -56,10 +56,10 @@ class Server(object):
self.bot.events.on("timer").on("rejoin").hook(self.try_rejoin) self.bot.events.on("timer").on("rejoin").hook(self.try_rejoin)
def __repr__(self): def __repr__(self):
return "IRCServer.Server(%s:%s%s)" % (self.target_hostname, return "IRCServer.Server(%s)" % self.__str__()
"+" if self.tls else "", self.port)
def __str__(self): def __str__(self):
return repr(self) return "%s:%s%s" % (self.target_hostname, "+" if self.tls else "",
self.port)
def fileno(self): def fileno(self):
fileno = self.socket.fileno() fileno = self.socket.fileno()
return self.cached_fileno if fileno == -1 else fileno return self.cached_fileno if fileno == -1 else fileno