simplify Client/ServerConnection.__repr__

This commit is contained in:
Maximilian Hils 2015-11-26 23:15:21 +01:00
parent 89013eb7af
commit a9f64c22f8
1 changed files with 4 additions and 6 deletions

View File

@ -31,10 +31,9 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
return bool(self.connection) and not self.finished
def __repr__(self):
return "<ClientConnection: {ssl}{host}:{port}>".format(
return "<ClientConnection: {ssl}{address}>".format(
ssl="[ssl] " if self.ssl_established else "",
host=self.address.host,
port=self.address.port
address=repr(self.address)
)
@property
@ -109,10 +108,9 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
ssl = "[ssl] "
else:
ssl = ""
return "<ServerConnection: {ssl}{host}:{port}>".format(
return "<ServerConnection: {ssl}{address}>".format(
ssl=ssl,
host=self.address.host,
port=self.address.port
address=repr(self.address)
)
@property