Add automatic docstring formatter and apply

This commit is contained in:
Dominik Muhs
2019-10-24 08:41:10 +02:00
parent 30aeb35122
commit eef505f2d9
74 changed files with 565 additions and 760 deletions

View File

@ -14,8 +14,8 @@ class IMuxedConn(ABC):
@abstractmethod
def __init__(self, conn: ISecureConn, peer_id: ID) -> None:
"""
create a new muxed connection
"""create a new muxed connection.
:param conn: an instance of secured connection
for new muxed streams
:param peer_id: peer_id of peer the connection is to
@ -28,29 +28,25 @@ class IMuxedConn(ABC):
@abstractmethod
async def close(self) -> None:
"""
close connection
"""
"""close connection."""
@abstractmethod
def is_closed(self) -> bool:
"""
check connection is fully closed
"""check connection is fully closed.
:return: true if successful
"""
@abstractmethod
async def open_stream(self) -> "IMuxedStream":
"""
creates a new muxed_stream
"""creates a new muxed_stream.
:return: a new ``IMuxedStream`` stream
"""
@abstractmethod
async def accept_stream(self) -> "IMuxedStream":
"""
accepts a muxed stream opened by the other end
"""
"""accepts a muxed stream opened by the other end."""
class IMuxedStream(ReadWriteCloser):
@ -59,14 +55,11 @@ class IMuxedStream(ReadWriteCloser):
@abstractmethod
async def reset(self) -> None:
"""
closes both ends of the stream
tells this remote side to hang up
"""
"""closes both ends of the stream tells this remote side to hang up."""
@abstractmethod
def set_deadline(self, ttl: int) -> bool:
"""
set deadline for muxed stream
"""set deadline for muxed stream.
:return: a new stream
"""