mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-09 14:40:53 +00:00
Enforce pre-summary newline in docstrings
This commit is contained in:
@ -12,7 +12,8 @@ class IAddrBook(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def add_addr(self, peer_id: ID, addr: Multiaddr, ttl: int) -> None:
|
||||
"""Calls add_addrs(peer_id, [addr], ttl)
|
||||
"""
|
||||
Calls add_addrs(peer_id, [addr], ttl)
|
||||
|
||||
:param peer_id: the peer to add address for
|
||||
:param addr: multiaddress of the peer
|
||||
@ -21,9 +22,10 @@ class IAddrBook(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def add_addrs(self, peer_id: ID, addrs: Sequence[Multiaddr], ttl: int) -> None:
|
||||
"""Adds addresses for a given peer all with the same time-to-live. If
|
||||
one of the addresses already exists for the peer and has a longer TTL,
|
||||
no operation should take place. If one of the addresses exists with a
|
||||
"""
|
||||
Adds addresses for a given peer all with the same time-to-live. If one
|
||||
of the addresses already exists for the peer and has a longer TTL, no
|
||||
operation should take place. If one of the addresses exists with a
|
||||
shorter TTL, extend the TTL to equal param ttl.
|
||||
|
||||
:param peer_id: the peer to add address for
|
||||
@ -40,7 +42,8 @@ class IAddrBook(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def clear_addrs(self, peer_id: ID) -> None:
|
||||
"""Removes all previously stored addresses.
|
||||
"""
|
||||
Removes all previously stored addresses.
|
||||
|
||||
:param peer_id: peer to remove addresses of
|
||||
"""
|
||||
|
||||
@ -17,7 +17,8 @@ class PeerStore(IPeerStore):
|
||||
self.peer_map = {}
|
||||
|
||||
def __create_or_get_peer(self, peer_id: ID) -> PeerData:
|
||||
"""Returns the peer data for peer_id or creates a new peer data (and
|
||||
"""
|
||||
Returns the peer data for peer_id or creates a new peer data (and
|
||||
stores it in peer_map) if peer data for peer_id does not yet exist.
|
||||
|
||||
:param peer_id: peer ID
|
||||
|
||||
Reference in New Issue
Block a user