diff options
author | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-10 19:45:30 +0100 |
---|---|---|
committer | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-10 19:45:30 +0100 |
commit | 1e2d15b8f58249b31dd5882772d58add1369fc37 (patch) | |
tree | 6d39e5fc8241884acf30b209a07ef4cabd80c323 /slixmpp/plugins/xep_0202/stanza.py | |
parent | d37182804102682a715df43c48a6d874835cd71a (diff) | |
parent | 155fc58a22d631746436a81119a94c80d6ea2d2b (diff) | |
download | slixmpp-1e2d15b8f58249b31dd5882772d58add1369fc37.tar.gz slixmpp-1e2d15b8f58249b31dd5882772d58add1369fc37.tar.bz2 slixmpp-1e2d15b8f58249b31dd5882772d58add1369fc37.tar.xz slixmpp-1e2d15b8f58249b31dd5882772d58add1369fc37.zip |
Merge branch 'docs-event-sphinx-plugins' into 'master'
Docs: add more events, add plugins to the doc
See merge request poezio/slixmpp!84
Diffstat (limited to 'slixmpp/plugins/xep_0202/stanza.py')
-rw-r--r-- | slixmpp/plugins/xep_0202/stanza.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/slixmpp/plugins/xep_0202/stanza.py b/slixmpp/plugins/xep_0202/stanza.py index 4c7a0229..e71ffe9c 100644 --- a/slixmpp/plugins/xep_0202/stanza.py +++ b/slixmpp/plugins/xep_0202/stanza.py @@ -23,6 +23,8 @@ class EntityTime(ElementBase): included. Example <time> stanzas: + :: + <iq type="result"> <time xmlns="urn:xmpp:time"> <utc>2011-07-03T11:37:12.234569</utc> @@ -31,18 +33,11 @@ class EntityTime(ElementBase): </iq> Stanza Interface: + :: + time -- The local time for the entity (updates utc and tzo). utc -- The UTC equivalent to local time. tzo -- The local timezone offset from UTC. - - Methods: - get_time -- Return local time datetime object. - set_time -- Set UTC and TZO fields. - del_time -- Remove both UTC and TZO fields. - get_utc -- Return datetime object of UTC time. - set_utc -- Set the UTC time. - get_tzo -- Return tzinfo object. - set_tzo -- Set the local timezone offset. """ name = 'time' @@ -55,9 +50,8 @@ class EntityTime(ElementBase): """ Set both the UTC and TZO fields given a time object. - Arguments: - value -- A datetime object or properly formatted - string equivalent. + :param value: A datetime object or properly formatted + string equivalent. """ date = value if not isinstance(value, dt.datetime): @@ -92,9 +86,8 @@ class EntityTime(ElementBase): """ Set the timezone offset from UTC. - Arguments: - value -- Either a tzinfo object or the number of - seconds (positive or negative) to offset. + :param value: Either a tzinfo object or the number of + seconds (positive or negative) to offset. """ time = xep_0082.time(offset=value) if xep_0082.parse(time).tzinfo == tzutc(): @@ -115,9 +108,8 @@ class EntityTime(ElementBase): """ Set the time in UTC. - Arguments: - value -- A datetime object or properly formatted - string equivalent. + :param value: A datetime object or properly formatted + string equivalent. """ date = value if not isinstance(value, dt.datetime): |