From 95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 10 Dec 2020 19:20:23 +0100 Subject: docs: update docstrings for sphinx conformity Remove most references to timeout/callback/ifrom/timeout_callbacks args --- slixmpp/plugins/xep_0080/geoloc.py | 84 +++++++++++++++----------------------- slixmpp/plugins/xep_0080/stanza.py | 36 ++++++++-------- 2 files changed, 51 insertions(+), 69 deletions(-) (limited to 'slixmpp/plugins/xep_0080') diff --git a/slixmpp/plugins/xep_0080/geoloc.py b/slixmpp/plugins/xep_0080/geoloc.py index 459d8a91..e229bf5e 100644 --- a/slixmpp/plugins/xep_0080/geoloc.py +++ b/slixmpp/plugins/xep_0080/geoloc.py @@ -39,48 +39,40 @@ class XEP_0080(BasePlugin): """ Publish the user's current location. - Arguments: - accuracy -- Horizontal GPS error in meters. - alt -- Altitude in meters above or below sea level. - area -- A named area such as a campus or neighborhood. - bearing -- GPS bearing (direction in which the entity is - heading to reach its next waypoint), measured in - decimal degrees relative to true north. - building -- A specific building on a street or in an area. - country -- The nation where the user is located. - countrycode -- The ISO 3166 two-letter country code. - datum -- GPS datum. - description -- A natural-language name for or description of - the location. - error -- Horizontal GPS error in arc minutes. Obsoleted by - the accuracy parameter. - floor -- A particular floor in a building. - lat -- Latitude in decimal degrees North. - locality -- A locality within the administrative region, such - as a town or city. - lon -- Longitude in decimal degrees East. - postalcode -- A code used for postal delivery. - region -- An administrative region of the nation, such - as a state or province. - room -- A particular room in a building. - speed -- The speed at which the entity is moving, - in meters per second. - street -- A thoroughfare within the locality, or a crossing - of two thoroughfares. - text -- A catch-all element that captures any other - information about the location. - timestamp -- UTC timestamp specifying the moment when the - reading was taken. - uri -- A URI or URL pointing to information about - the location. - - options -- Optional form of publish options. - ifrom -- Specify the sender's JID. - timeout -- The length of time (in seconds) to wait for a response - before exiting the send call if blocking is used. - Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT - callback -- Optional reference to a stream handler function. Will - be executed when a reply stanza is received. + :param accuracy: Horizontal GPS error in meters. + :param alt: Altitude in meters above or below sea level. + :param area: A named area such as a campus or neighborhood. + :param bearing: GPS bearing (direction in which the entity is + heading to reach its next waypoint), measured in + decimal degrees relative to true north. + :param building: A specific building on a street or in an area. + :param country: The nation where the user is located. + :param countrycode: The ISO 3166 two-letter country code. + :param datum: GPS datum. + :param description: A natural-language name for or description of + the location. + :param error: Horizontal GPS error in arc minutes. Obsoleted by + the accuracy parameter. + :param floor: A particular floor in a building. + :param lat: Latitude in decimal degrees North. + :param locality: A locality within the administrative region, such + as a town or city. + :param lon: Longitude in decimal degrees East. + :param postalcode: A code used for postal delivery. + :param region: An administrative region of the nation, such + as a state or province. + :param room: A particular room in a building. + :param speed: The speed at which the entity is moving, + in meters per second. + :param street: A thoroughfare within the locality, or a crossing + of two thoroughfares. + :param text: A catch-all element that captures any other + information about the location. + :param timestamp: UTC timestamp specifying the moment when the + reading was taken. + :param uri: A URI or URL pointing to information about + the location. + :param options: Optional form of publish options. """ options = kwargs.get('options', None) ifrom = kwargs.get('ifrom', None) @@ -104,14 +96,6 @@ class XEP_0080(BasePlugin): def stop(self, ifrom=None, callback=None, timeout=None, timeout_callback=None): """ Clear existing user location information to stop notifications. - - Arguments: - ifrom -- Specify the sender's JID. - timeout -- The length of time (in seconds) to wait for a response - before exiting the send call if blocking is used. - Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT - callback -- Optional reference to a stream handler function. Will - be executed when a reply stanza is received. """ geoloc = Geoloc() return self.xmpp['xep_0163'].publish(geoloc, diff --git a/slixmpp/plugins/xep_0080/stanza.py b/slixmpp/plugins/xep_0080/stanza.py index adad6321..c63803bd 100644 --- a/slixmpp/plugins/xep_0080/stanza.py +++ b/slixmpp/plugins/xep_0080/stanza.py @@ -17,6 +17,9 @@ class Geoloc(ElementBase): geographical or physical location of an entity. (XEP-0080: User Location) Example stanzas: + + :: + @@ -28,6 +31,8 @@ class Geoloc(ElementBase): Stanza Interface: + :: + accuracy -- Horizontal GPS error in meters. alt -- Altitude in meters above or below sea level. area -- A named area such as a campus or neighborhood. @@ -61,6 +66,7 @@ class Geoloc(ElementBase): reading was taken. uri -- A URI or URL pointing to information about the location. + """ namespace = 'http://jabber.org/protocol/geoloc' @@ -83,8 +89,7 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - accuracy -- Horizontal GPS error in meters + :param accuracy: Horizontal GPS error in meters """ self._set_sub_text('accuracy', text=str(accuracy)) return self @@ -106,8 +111,7 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - alt -- Altitude in meters above or below sea level + :param alt: Altitude in meters above or below sea level """ self._set_sub_text('alt', text=str(alt)) return self @@ -129,8 +133,7 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - bearing -- GPS bearing (direction in which the entity is heading + :param bearing: GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north """ @@ -154,9 +157,8 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - error -- Horizontal GPS error in arc minutes; this - element is deprecated in favor of + :param error: Horizontal GPS error in arc minutes; this + element is deprecated in favor of """ self._set_sub_text('error', text=str(error)) return self @@ -178,8 +180,7 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - lat -- Latitude in decimal degrees North + :param lat: Latitude in decimal degrees North """ self._set_sub_text('lat', text=str(lat)) return self @@ -201,8 +202,7 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - lon -- Longitude in decimal degrees East + :param lon: Longitude in decimal degrees East """ self._set_sub_text('lon', text=str(lon)) return self @@ -224,9 +224,8 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - speed -- The speed at which the entity is moving, - in meters per second + :param speed: The speed at which the entity is moving, + in meters per second """ self._set_sub_text('speed', text=str(speed)) return self @@ -248,9 +247,8 @@ class Geoloc(ElementBase): """ Set the value of the element. - Arguments: - timestamp -- UTC timestamp specifying the moment when - the reading was taken + :param timestamp: UTC timestamp specifying the moment when + the reading was taken """ self._set_sub_text('timestamp', text=str(xep_0082.datetime(timestamp))) return self -- cgit v1.2.3