From a9f64c22f8395a1251b1d94c9ce516d467ad12e4 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 26 Nov 2015 23:15:21 +0100 Subject: [PATCH] simplify Client/ServerConnection.__repr__ --- libmproxy/models/connections.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libmproxy/models/connections.py b/libmproxy/models/connections.py index ec0894716..3aa522eac 100644 --- a/libmproxy/models/connections.py +++ b/libmproxy/models/connections.py @@ -31,10 +31,9 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): return bool(self.connection) and not self.finished def __repr__(self): - return "".format( + return "".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 "".format( + return "".format( ssl=ssl, - host=self.address.host, - port=self.address.port + address=repr(self.address) ) @property