diff options
author | mathieui <mathieui@mathieui.net> | 2020-12-10 19:20:23 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2020-12-10 19:22:40 +0100 |
commit | 95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c (patch) | |
tree | ef3086be7313a8e61e51b7a3efed302d0e154cb0 /slixmpp/plugins/xep_0199/ping.py | |
parent | 010bf6dd70a44d9e9087336bc955a591ab9248b3 (diff) | |
download | slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.gz slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.bz2 slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.xz slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.zip |
docs: update docstrings for sphinx conformity
Remove most references to timeout/callback/ifrom/timeout_callbacks args
Diffstat (limited to 'slixmpp/plugins/xep_0199/ping.py')
-rw-r--r-- | slixmpp/plugins/xep_0199/ping.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/slixmpp/plugins/xep_0199/ping.py b/slixmpp/plugins/xep_0199/ping.py index adbf2203..d1a82026 100644 --- a/slixmpp/plugins/xep_0199/ping.py +++ b/slixmpp/plugins/xep_0199/ping.py @@ -9,6 +9,8 @@ import time import logging +from typing import Optional, Callable + from slixmpp.jid import JID from slixmpp.stanza import Iq from slixmpp import asyncio @@ -123,17 +125,13 @@ class XEP_0199(BasePlugin): log.debug("Pinged by %s", iq['from']) iq.reply().send() - def send_ping(self, jid, ifrom=None, timeout=None, callback=None, - timeout_callback=None): + def send_ping(self, jid: JID, ifrom: Optional[JID] = None, + timeout: Optional[int] = None, + callback: Optional[Callable] = None, + timeout_callback: Optional[Callable] = None): """Send a ping request. - Arguments: - jid -- The JID that will receive the ping. - ifrom -- Specifiy the sender JID. - timeout -- Time in seconds to wait for a response. - Defaults to self.timeout. - callback -- Optional handler to execute when a pong - is received. + :param jid: The JID that will receive the ping. """ if not timeout: timeout = self.timeout @@ -147,15 +145,12 @@ class XEP_0199(BasePlugin): return iq.send(timeout=timeout, callback=callback, timeout_callback=timeout_callback) - async def ping(self, jid=None, ifrom=None, timeout=None): + async def ping(self, jid: Optional[JID] =None, + ifrom: Optional[JID] = None, timeout: Optional[int] = None) -> float: """Send a ping request and calculate RTT. This is a coroutine. - Arguments: - jid -- The JID that will receive the ping. - ifrom -- Specifiy the sender JID. - timeout -- Time in seconds to wait for a response. - Defaults to self.timeout. + :param jid: The JID that will receive the ping. """ own_host = False if not jid: |