Merge pull request #331 from dmuhs/fix/docs-format

Add automatic docstring formatting
This commit is contained in:
Piper Merriam
2019-10-28 09:39:52 -06:00
committed by GitHub
73 changed files with 519 additions and 561 deletions

View File

@ -11,11 +11,9 @@ PROTOCOL_NOT_FOUND_MSG = "na"
class Multiselect(IMultiselectMuxer):
"""
Multiselect module that is responsible for responding to
a multiselect client and deciding on
a specific protocol and handler pair to use for communication
"""
"""Multiselect module that is responsible for responding to a multiselect
client and deciding on a specific protocol and handler pair to use for
communication."""
handlers: Dict[TProtocol, StreamHandlerFn]
@ -28,7 +26,8 @@ class Multiselect(IMultiselectMuxer):
def add_handler(self, protocol: TProtocol, handler: StreamHandlerFn) -> None:
"""
Store the handler with the given protocol
Store the handler with the given protocol.
:param protocol: protocol name
:param handler: handler function
"""
@ -38,7 +37,8 @@ class Multiselect(IMultiselectMuxer):
self, communicator: IMultiselectCommunicator
) -> Tuple[TProtocol, StreamHandlerFn]:
"""
Negotiate performs protocol selection
Negotiate performs protocol selection.
:param stream: stream to negotiate on
:return: selected protocol name, handler function
:raise MultiselectError: raised when negotiation failed
@ -70,7 +70,8 @@ class Multiselect(IMultiselectMuxer):
async def handshake(self, communicator: IMultiselectCommunicator) -> None:
"""
Perform handshake to agree on multiselect protocol
Perform handshake to agree on multiselect protocol.
:param communicator: communicator to use
:raise MultiselectError: raised when handshake failed
"""
@ -93,7 +94,8 @@ class Multiselect(IMultiselectMuxer):
def is_valid_handshake(handshake_contents: str) -> bool:
"""
Determine if handshake is valid and should be confirmed
Determine if handshake is valid and should be confirmed.
:param handshake_contents: contents of handshake message
:return: true if handshake is complete, false otherwise
"""