Improve IRCServer.Server's __repr__

This commit is contained in:
jesopo 2018-08-28 15:14:41 +01:00
parent f2b2ac52e7
commit ab543022c4

View file

@ -54,9 +54,10 @@ class Server(object):
self.socket = context.wrap_socket(self.socket) self.socket = context.wrap_socket(self.socket)
self.cached_fileno = self.socket.fileno() self.cached_fileno = self.socket.fileno()
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 "%s:%s%s" % (self.target_hostname, "+" if self.tls else "", return "IRCServer.Server(%s:%s%s)" % (self.target_hostname,
self.port) "+" if self.tls else "", self.port)
def __str__(self): def __str__(self):
return repr(self) return repr(self)
def fileno(self): def fileno(self):