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_0059/stanza.py | 69 ++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 29 deletions(-) (limited to 'slixmpp/plugins/xep_0059') diff --git a/slixmpp/plugins/xep_0059/stanza.py b/slixmpp/plugins/xep_0059/stanza.py index b74ac1e8..e1942ee4 100644 --- a/slixmpp/plugins/xep_0059/stanza.py +++ b/slixmpp/plugins/xep_0059/stanza.py @@ -18,26 +18,30 @@ class Set(ElementBase): per response or starting at certain positions. Example set stanzas: - - - - 2 - - - - - - - - - - conference.example.com - pubsub.example.com - - - + :: + + + + + 2 + + + + + + + + + + conference.example.com + pubsub.example.com + + + Stanza Interface: + :: + first_index -- The index attribute of after -- The id defining from which item to start before -- The id defining from which item to @@ -48,17 +52,6 @@ class Set(ElementBase): index -- Used to set an index to start from count -- The number of remote items available - Methods: - set_first_index -- Sets the index attribute for and - creates the element if it doesn't exist - get_first_index -- Returns the value of the index - attribute for - del_first_index -- Removes the index attribute for - but keeps the element - set_before -- Sets the value of , if the value is True - then the element will be created without a value - get_before -- Returns the value of , if it is - empty it will return True """ namespace = 'http://jabber.org/protocol/rsm' @@ -70,6 +63,10 @@ class Set(ElementBase): 'count', 'index', 'last', 'max'} def set_first_index(self, val): + """ + Sets the index attribute for and + creates the element if it doesn't exist + """ fi = self.xml.find("{%s}first" % (self.namespace)) if fi is not None: if val: @@ -82,16 +79,26 @@ class Set(ElementBase): self.xml.append(fi) def get_first_index(self): + """ + Returns the value of the index attribute for + """ fi = self.xml.find("{%s}first" % (self.namespace)) if fi is not None: return fi.attrib.get('index', '') def del_first_index(self): + """ + Removes the index attribute for but keeps the element + """ fi = self.xml.find("{%s}first" % (self.namespace)) if fi is not None: del fi.attrib['index'] def set_before(self, val): + """ + Sets the value of , if the value is True + then the element will be created without a value + """ b = self.xml.find("{%s}before" % (self.namespace)) if b is None and val is True: self._set_sub_text('{%s}before' % self.namespace, '', True) @@ -99,6 +106,10 @@ class Set(ElementBase): self._set_sub_text('{%s}before' % self.namespace, val) def get_before(self): + """ + Returns the value of , if it is + empty it will return True + """ b = self.xml.find("{%s}before" % (self.namespace)) if b is not None and not b.text: return True -- cgit v1.2.3