Merge pull request #176 from NIC619/small_fix_on_docstring

Fix some docstrings
This commit is contained in:
NIC Lin 2019-07-20 22:12:08 +08:00 committed by GitHub
commit d37f7f64e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ def generate_id():
def initialize_default_kademlia_router( def initialize_default_kademlia_router(
ksize=20, alpha=3, id_opt=None, storage=None): ksize=20, alpha=3, id_opt=None, storage=None):
""" """
initialize swam when no swarm is passed in initialize kadmelia router when no kademlia router is passed in
:param ksize: The k parameter from the paper :param ksize: The k parameter from the paper
:param alpha: The alpha parameter from the paper :param alpha: The alpha parameter from the paper
:param id_opt: optional id for host :param id_opt: optional id for host
@ -62,6 +62,7 @@ def initialize_default_swarm(
:param muxer_opt: optional choice of stream muxer :param muxer_opt: optional choice of stream muxer
:param sec_opt: optional choice of security upgrade :param sec_opt: optional choice of security upgrade
:param peerstore_opt: optional peerstore :param peerstore_opt: optional peerstore
:param disc_opt: optional discovery
:return: return a default swarm instance :return: return a default swarm instance
""" """
# pylint: disable=too-many-arguments, unused-argument # pylint: disable=too-many-arguments, unused-argument
@ -80,6 +81,7 @@ def initialize_default_swarm(
upgrader = TransportUpgrader(sec, muxer) upgrader = TransportUpgrader(sec, muxer)
peerstore = peerstore_opt or PeerStore() peerstore = peerstore_opt or PeerStore()
# TODO: Initialize discovery if not presented
swarm_opt = Swarm(id_opt, peerstore,\ swarm_opt = Swarm(id_opt, peerstore,\
upgrader, transport, disc_opt) upgrader, transport, disc_opt)
@ -92,12 +94,14 @@ async def new_node(
disc_opt=None): disc_opt=None):
""" """
create new libp2p node create new libp2p node
:param swarm_opt: optional swarm
:param id_opt: optional id for host :param id_opt: optional id for host
:param transport_opt: optional choice of transport upgrade :param transport_opt: optional choice of transport upgrade
:param muxer_opt: optional choice of stream muxer :param muxer_opt: optional choice of stream muxer
:param sec_opt: optional choice of security upgrade :param sec_opt: optional choice of security upgrade
:param peerstore_opt: optional peerstore :param peerstore_opt: optional peerstore
:return: return a default swarm instance :param disc_opt: optional discovery
:return: return a host instance
""" """
# pylint: disable=too-many-arguments # pylint: disable=too-many-arguments