Run black and isort w/ the new config

This commit is contained in:
Alex Stokes
2019-08-13 14:36:42 -07:00
parent 87375e0f23
commit 3debd2c808
37 changed files with 273 additions and 88 deletions

View File

@ -38,7 +38,9 @@ class INetwork(ABC):
"""
@abstractmethod
def set_stream_handler(self, protocol_id: TProtocol, stream_handler: StreamHandlerFn) -> bool:
def set_stream_handler(
self, protocol_id: TProtocol, stream_handler: StreamHandlerFn
) -> bool:
"""
:param protocol_id: protocol id used on stream
:param stream_handler: a stream handler instance
@ -46,7 +48,9 @@ class INetwork(ABC):
"""
@abstractmethod
async def new_stream(self, peer_id: ID, protocol_ids: Sequence[TProtocol]) -> INetStream:
async def new_stream(
self, peer_id: ID, protocol_ids: Sequence[TProtocol]
) -> INetStream:
"""
:param peer_id: peer_id of destination
:param protocol_ids: available protocol ids to use for stream

View File

@ -68,7 +68,9 @@ class Swarm(INetwork):
def get_peer_id(self) -> ID:
return self.self_id
def set_stream_handler(self, protocol_id: TProtocol, stream_handler: StreamHandlerFn) -> bool:
def set_stream_handler(
self, protocol_id: TProtocol, stream_handler: StreamHandlerFn
) -> bool:
"""
:param protocol_id: protocol id used on stream
:param stream_handler: a stream handler instance
@ -121,7 +123,9 @@ class Swarm(INetwork):
return muxed_conn
async def new_stream(self, peer_id: ID, protocol_ids: Sequence[TProtocol]) -> NetStream:
async def new_stream(
self, peer_id: ID, protocol_ids: Sequence[TProtocol]
) -> NetStream:
"""
:param peer_id: peer_id of destination
:param protocol_id: protocol id
@ -196,7 +200,9 @@ class Swarm(INetwork):
# Per, https://discuss.libp2p.io/t/multistream-security/130, we first secure
# the conn and then mux the conn
secured_conn = await self.upgrader.upgrade_security(raw_conn, peer_id, False)
secured_conn = await self.upgrader.upgrade_security(
raw_conn, peer_id, False
)
muxed_conn = self.upgrader.upgrade_connection(
secured_conn, self.generic_protocol_handler, peer_id
)