The documentation effort continues.

Also, need to start working on a replacement for the XEP-30 page in the
wiki since the API has changed significantly.
This commit is contained in:
Lance Stout 2010-12-15 17:58:15 -05:00
parent 2f4bdfee1b
commit d8aae88526

View file

@ -123,9 +123,12 @@ class xep_0030(base_plugin):
Arguments: Arguments:
htype -- The operation provided by the handler. htype -- The operation provided by the handler.
jid -- jid -- The JID the handler applies to. May be narrowed
node -- further if a node is given.
handler -- node -- The particular node the handler is for. If no JID
is given, then the self.xmpp.boundjid.full is
assumed.
handler -- The handler function to use.
""" """
if htype not in self._disco_ops: if htype not in self._disco_ops:
return return
@ -185,14 +188,28 @@ class xep_0030(base_plugin):
def get_info(self, jid=None, node=None, local=False, **kwargs): def get_info(self, jid=None, node=None, local=False, **kwargs):
""" """
Retrieve the disco#info results from a given JID/node combination.
Info may be retrieved from both local resources and remote agents;
the local parameter indicates if the information should be gathered
by executing the local node handlers, or if a disco#info stanza
must be generated and sent.
Arguments: Arguments:
jid -- jid -- Request info from this JID.
node -- node -- The particular node to query.
local -- local -- If true, then the query is for a JID/node
dfrom -- combination handled by this Sleek instance and
block -- no stanzas need to be sent.
timeout -- Otherwise, a disco stanza must be sent to the
callback -- remove JID to retrieve the info.
dfrom -- Specifiy the sender's JID.
block -- If true, block and wait for the stanzas' reply.
timeout -- The time in seconds to block while waiting for
a reply. If None, then wait indefinitely.
callback -- Optional callback to execute when a reply is
received instead of blocking and waiting for
the reply.
""" """
if local or jid is None: if local or jid is None:
log.debug("Looking up local disco#info data " + \ log.debug("Looking up local disco#info data " + \
@ -211,14 +228,28 @@ class xep_0030(base_plugin):
def get_items(self, jid=None, node=None, local=False, **kwargs): def get_items(self, jid=None, node=None, local=False, **kwargs):
""" """
Retrieve the disco#items results from a given JID/node combination.
Items may be retrieved from both local resources and remote agents;
the local parameter indicates if the items should be gathered by
executing the local node handlers, or if a disco#items stanza must
be generated and sent.
Arguments: Arguments:
jid -- jid -- Request info from this JID.
node -- node -- The particular node to query.
local -- local -- If true, then the query is for a JID/node
dfrom -- combination handled by this Sleek instance and
block -- no stanzas need to be sent.
timeout -- Otherwise, a disco stanza must be sent to the
callback -- remove JID to retrieve the items.
dfrom -- Specifiy the sender's JID.
block -- If true, block and wait for the stanzas' reply.
timeout -- The time in seconds to block while waiting for
a reply. If None, then wait indefinitely.
callback -- Optional callback to execute when a reply is
received instead of blocking and waiting for
the reply.
""" """
if local or jid is None: if local or jid is None:
return self._run_node_handler('get_items', jid, node, kwargs) return self._run_node_handler('get_items', jid, node, kwargs)