From 98cce7fab779da2c66132bb0185e6f96711a4805 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 5 Jul 2019 15:41:39 -0700 Subject: [PATCH] connector: tidy Factory reprs --- src/wormhole/_dilation/connector.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wormhole/_dilation/connector.py b/src/wormhole/_dilation/connector.py index 83914e3..2ff6ae0 100644 --- a/src/wormhole/_dilation/connector.py +++ b/src/wormhole/_dilation/connector.py @@ -400,12 +400,15 @@ class Connector(object): # our Connection protocols call: add_candidate -@attrs +@attrs(repr=False) class OutboundConnectionFactory(ClientFactory, object): _connector = attrib(validator=provides(IDilationConnector)) _relay_handshake = attrib(validator=optional(instance_of(bytes))) _description = attrib() + def __repr__(self): + return "OutboundConnectionFactory(%s %s)" % (self._connector._role, self._description) + def buildProtocol(self, addr): p = self._connector.build_protocol(addr, self._description) p.factory = self @@ -420,10 +423,13 @@ def describe_inbound(addr): return "<-tcp:%s:%d" % (addr.host, addr.port) return "<-%r" % addr -@attrs +@attrs(repr=False) class InboundConnectionFactory(ServerFactory, object): _connector = attrib(validator=provides(IDilationConnector)) + def __repr__(self): + return "InboundConnectionFactory(%s)" % (self._connector._role) + def buildProtocol(self, addr): description = describe_inbound(addr) p = self._connector.build_protocol(addr, description)