DilatedConnectionProtocol/Role: prettier repr
This commit is contained in:
parent
ebc63e52e0
commit
53ad951c11
|
@ -473,13 +473,13 @@ class DilatedConnectionProtocol(Protocol, object):
|
||||||
At any given time, there is at most one active L2 connection.
|
At any given time, there is at most one active L2 connection.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_eventual_queue = attrib()
|
_eventual_queue = attrib(repr=False)
|
||||||
_role = attrib()
|
_role = attrib()
|
||||||
_description = attrib()
|
_description = attrib()
|
||||||
_connector = attrib(validator=provides(IDilationConnector))
|
_connector = attrib(validator=provides(IDilationConnector), repr=False)
|
||||||
_noise = attrib()
|
_noise = attrib(repr=False)
|
||||||
_outbound_prologue = attrib(validator=instance_of(bytes))
|
_outbound_prologue = attrib(validator=instance_of(bytes), repr=False)
|
||||||
_inbound_prologue = attrib(validator=instance_of(bytes))
|
_inbound_prologue = attrib(validator=instance_of(bytes), repr=False)
|
||||||
|
|
||||||
_use_relay = False
|
_use_relay = False
|
||||||
_relay_handshake = None
|
_relay_handshake = None
|
||||||
|
|
|
@ -1 +1,7 @@
|
||||||
LEADER, FOLLOWER = object(), object()
|
class _Role(object):
|
||||||
|
def __init__(self, which):
|
||||||
|
self._which = which
|
||||||
|
def __repr__(self):
|
||||||
|
return "Role(%s)" % self._which
|
||||||
|
|
||||||
|
LEADER, FOLLOWER = _Role("LEADER"), _Role("FOLLOWER")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user