Package pyxmpp2 :: Package ext :: Module version
[hide private]

Module version

Software Version query and advertisement.

To advertise software version in your client or component add a VersionProvider instance to your payload.

To request a remote entity version information, use the request_software_version function.

Normative reference:
Classes [hide private]
  VersionPayload
Software version (XEP-0092) stanza payload.
  VersionProvider
Provides the Software version (XEP-0092) service.
Functions [hide private]
 
request_software_version(stanza_processor, target_jid, callback, error_callback=None)
Request software version information from a remote entity.
 
_os_name_factory(settings)
Factory for the software_os setting default.
 
_version_factory(settings)
Factory for the software_version setting default.
Variables [hide private]
  logger = logging.getLogger("pyxmpp2.ext.version")
  _QNP = u'{jabber:iq:version}'
  QUERY_TAG = u'{jabber:iq:version}query'
  NAME_TAG = u'{jabber:iq:version}name'
  VERSION_TAG = u'{jabber:iq:version}version'
  OS_TAG = u'{jabber:iq:version}os'
Function Details [hide private]

request_software_version(stanza_processor, target_jid, callback, error_callback=None)

 

Request software version information from a remote entity.

When a valid response is received the callback will be handled with a VersionPayload instance as its only argument. The object will provide the requested infromation.

In case of error stanza received or invalid response the error_callback (if provided) will be called with the offending stanza (which can be <iq type='error'/> or <iq type='result'>) as its argument.

The same function will be called on timeout, with the argument set to None.

Parameters:
  • stanza_processor (StanzaProcessor) - a object used to send the query and handle response. E.g. a pyxmpp2.client.Client instance
  • target_jid (JID) - the JID of the entity to query
  • callback - function to be called with a valid response
  • error_callback - function to be called on error