Package xmpp :: Module features

[hide private]
[frames] | no frames]

# Module features

source code

    This module contains variable stuff that is not worth splitting into separate modules.
    Here is:
        DISCO client and agents-to-DISCO and browse-to-DISCO emulators.
        IBR and password manager.
        jabber:iq:privacy methods
    All these methods takes 'disp' first argument that should be already connected
    (and in most cases already authorised) dispatcher instance.

Functions | [hide private]

_discover(disp, ns, jid, node=None, fb2b=0, fb2a=1) Try to obtain info from the remote object. | source code

discoverItems(disp, jid, node=None) Query remote object about any items that it contains. | source code

discoverInfo(disp, jid, node=None) Query remote object about info that it publishes. | source code

getRegInfo(disp, host, info=`{``}`, sync=True) Gets registration form from remote host. | source code

_ReceivedRegInfo(con, resp, agent) | source code

register(disp, host, info) Perform registration on remote server with provided info. | source code

unregister(disp, host) Unregisters with host (permanently removes account). | source code

changePasswordTo(disp, newpassword, host=None) Changes password on specified or current (if not specified) server. | source code

getPrivacyLists(disp) Requests privacy lists from connected server. | source code

getPrivacyList(disp, listname) Requests specific privacy list listname. | source code

setActivePrivacyList(disp, listname=None, typ=`'``active``'`) Switches privacy list 'listname' to specified type. | source code

setDefaultPrivacyList(disp, listname=None) Sets the default privacy list as 'listname'. | source code

setPrivacyList(disp, list) Set the ruleset. | source code

delPrivacyList(disp, listname) Deletes privacy list 'listname'. | source code

Variables | [hide private]

| REGISTER_DATA_RECEIVED = ``'``REGISTER DATA RECEIVED``'``
| ERRORS = ``{``'``urn:ietf:params:xml:ns:xmpp-sasl aborted``'``:` `[``'````'``,` `'````'``,``...``
| ERR_BAD_REQUEST = ``'``urn:ietf:params:xml:ns:xmpp-stanzas bad-req``...``
| ERR_CONFLICT = ``'``urn:ietf:params:xml:ns:xmpp-stanzas conflict``'``
| ERR_FEATURE_NOT_IMPLEMENTED = ``'``urn:ietf:params:xml:ns:xmpp-sta``...``
| ERR_FORBIDDEN = ``'``urn:ietf:params:xml:ns:xmpp-stanzas forbidden``'``
| ERR_GONE = ``'``urn:ietf:params:xml:ns:xmpp-stanzas gone``'``
| ERR_INTERNAL_SERVER_ERROR = ``'``urn:ietf:params:xml:ns:xmpp-stanz``...``
| ERR_ITEM_NOT_FOUND = ``'``urn:ietf:params:xml:ns:xmpp-stanzas item``...``
| ERR_JID_MALFORMED = ``'``urn:ietf:params:xml:ns:xmpp-stanzas jid-m``...``
| ERR_NOT_ACCEPTABLE = ``'``urn:ietf:params:xml:ns:xmpp-stanzas not-``...``
| ERR_NOT_ALLOWED = ``'``urn:ietf:params:xml:ns:xmpp-stanzas not-all``...``
| ERR_NOT_AUTHORIZED = ``'``urn:ietf:params:xml:ns:xmpp-stanzas not-``...``
| ERR_PAYMENT_REQUIRED = ``'``urn:ietf:params:xml:ns:xmpp-stanzas pa``...``
| ERR_RECIPIENT_UNAVAILABLE = ``'``urn:ietf:params:xml:ns:xmpp-stanz``...``
| ERR_REDIRECT = ``'``urn:ietf:params:xml:ns:xmpp-stanzas redirect``'``
| ERR_REGISTRATION_REQUIRED = ``'``urn:ietf:params:xml:ns:xmpp-stanz``...``
| ERR_REMOTE_SERVER_NOT_FOUND = ``'``urn:ietf:params:xml:ns:xmpp-sta``...``
| ERR_REMOTE_SERVER_TIMEOUT = ``'``urn:ietf:params:xml:ns:xmpp-stanz``...``
| ERR_RESOURCE_CONSTRAINT = ``'``urn:ietf:params:xml:ns:xmpp-stanzas``...``
| ERR_SERVICE_UNAVAILABLE = ``'``urn:ietf:params:xml:ns:xmpp-stanzas``...``
| ERR_SUBSCRIPTION_REQUIRED = ``'``urn:ietf:params:xml:ns:xmpp-stanz``...``
| ERR_UNDEFINED_CONDITION = ``'``urn:ietf:params:xml:ns:xmpp-stanzas``...``
| ERR_UNEXPECTED_REQUEST = ``'``urn:ietf:params:xml:ns:xmpp-stanzas` `...``
| SASL_ABORTED = ``'``urn:ietf:params:xml:ns:xmpp-sasl aborted``'``
| SASL_INCORRECT_ENCODING = ``'``urn:ietf:params:xml:ns:xmpp-sasl in``...``
| SASL_INVALID_AUTHZID = ``'``urn:ietf:params:xml:ns:xmpp-sasl inval``...``
| SASL_INVALID_MECHANISM = ``'``urn:ietf:params:xml:ns:xmpp-sasl inv``...``
| SASL_MECHANISM_TOO_WEAK = ``'``urn:ietf:params:xml:ns:xmpp-sasl me``...``
| SASL_NOT_AUTHORIZED = ``'``urn:ietf:params:xml:ns:xmpp-sasl not-au``...``
| SASL_TEMPORARY_AUTH_FAILURE = ``'``urn:ietf:params:xml:ns:xmpp-sas``...``
| STREAM_BAD_FORMAT = ``'``urn:ietf:params:xml:ns:xmpp-streams bad-f``...``
| STREAM_BAD_NAMESPACE_PREFIX = ``'``urn:ietf:params:xml:ns:xmpp-str``...``
| STREAM_CONFLICT = ``'``urn:ietf:params:xml:ns:xmpp-streams conflict``'``
| STREAM_CONNECTION_TIMEOUT = ``'``urn:ietf:params:xml:ns:xmpp-strea``...``
| STREAM_HOST_GONE = ``'``urn:ietf:params:xml:ns:xmpp-streams host-g``...``
| STREAM_HOST_UNKNOWN = ``'``urn:ietf:params:xml:ns:xmpp-streams hos``...``
| STREAM_IMPROPER_ADDRESSING = ``'``urn:ietf:params:xml:ns:xmpp-stre``...``
| STREAM_INTERNAL_SERVER_ERROR = ``'``urn:ietf:params:xml:ns:xmpp-st``...``
| STREAM_INVALID_FROM = ``'``urn:ietf:params:xml:ns:xmpp-streams inv``...``
| STREAM_INVALID_ID = ``'``urn:ietf:params:xml:ns:xmpp-streams inval``...``
| STREAM_INVALID_NAMESPACE = ``'``urn:ietf:params:xml:ns:xmpp-stream``...``
| STREAM_INVALID_XML = ``'``urn:ietf:params:xml:ns:xmpp-streams inva``...``
| STREAM_NOT_AUTHORIZED = ``'``urn:ietf:params:xml:ns:xmpp-streams n``...``
| STREAM_POLICY_VIOLATION = ``'``urn:ietf:params:xml:ns:xmpp-streams``...``
| STREAM_REMOTE_CONNECTION_FAILED = ``'``urn:ietf:params:xml:ns:xmpp``...``
| STREAM_RESOURCE_CONSTRAINT = ``'``urn:ietf:params:xml:ns:xmpp-stre``...``
| STREAM_RESTRICTED_XML = ``'``urn:ietf:params:xml:ns:xmpp-streams r``...``
| STREAM_SEE_OTHER_HOST = ``'``urn:ietf:params:xml:ns:xmpp-streams s``...``
| STREAM_SYSTEM_SHUTDOWN = ``'``urn:ietf:params:xml:ns:xmpp-streams` `...``
| STREAM_UNDEFINED_CONDITION = ``'``urn:ietf:params:xml:ns:xmpp-stre``...``
| STREAM_UNSUPPORTED_ENCODING = ``'``urn:ietf:params:xml:ns:xmpp-str``...``
| STREAM_UNSUPPORTED_STANZA_TYPE = ``'``urn:ietf:params:xml:ns:xmpp-``...``
| STREAM_UNSUPPORTED_VERSION = ``'``urn:ietf:params:xml:ns:xmpp-stre``...``
| STREAM_XML_NOT_WELL_FORMED = ``'``urn:ietf:params:xml:ns:xmpp-stre``...``
| name = ``'``SASL_TEMPORARY_AUTH_FAILURE``'``

Function Details | [hide private]

### _discover(disp, ns, jid, node=None, fb2b=0, fb2a=1)

source code

Try to obtain info from the remote object. If remote object doesn't support disco fall back to browse (if fb2b is true) and if it doesnt support browse (or fb2b is not true) fall back to agents protocol (if gb2a is true). Returns obtained info. Used internally.

### discoverItems(disp, jid, node=None)

source code

Query remote object about any items that it contains. Return items list.

### discoverInfo(disp, jid, node=None)

source code

Query remote object about info that it publishes. Returns identities and features lists.

### getRegInfo(disp, host, info=`{``}`, sync=True)

source code

Gets registration form from remote host. You can pre-fill the info dictionary. F.e. if you are requesting info on registering user joey than specify info as {'username':'joey'}. See JEP-0077 for details. 'disp' must be connected dispatcher instance.

### register(disp, host, info)

source code

Perform registration on remote server with provided info. disp must be connected dispatcher instance. Returns true or false depending on registration result. If registration fails you can get additional info from the dispatcher's owner attributes lastErrNode, lastErr and lastErrCode.

### unregister(disp, host)

source code

Unregisters with host (permanently removes account). disp must be connected and authorized dispatcher instance. Returns true on success.

### changePasswordTo(disp, newpassword, host=None)

source code

Changes password on specified or current (if not specified) server. disp must be connected and authorized dispatcher instance. Returns true on success.

### getPrivacyLists(disp)

source code

Requests privacy lists from connected server. Returns dictionary of existing lists on success.

### getPrivacyList(disp, listname)

source code

Requests specific privacy list listname. Returns list of XML nodes (rules) taken from the server responce.

### setActivePrivacyList(disp, listname=None, typ=`'``active``'`)

source code

Switches privacy list 'listname' to specified type. By default the type is 'active'. Returns true on success.

### setDefaultPrivacyList(disp, listname=None)

source code

Sets the default privacy list as 'listname'. Returns true on success.

### setPrivacyList(disp, list)

source code

Set the ruleset. 'list' should be the simpleXML node formatted according to RFC 3921 (XMPP-IM) (I.e. Node('list',{'name':listname},payload=[...]) ) Returns true on success.

### delPrivacyList(disp, listname)

source code

Deletes privacy list 'listname'. Returns true on success.

Variables Details | [hide private]

### ERRORS

Value:

      {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                                    '',
                                                    'The receiving entity ac
      knowledges an <abort/> element sent by the initiating entity; sent in
      reply to the <abort/> element.'],
       'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                               '',
                                                               'The data pro
      ...

### ERR_BAD_REQUEST

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

### ERR_FEATURE_NOT_IMPLEMENTED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

### ERR_INTERNAL_SERVER_ERROR

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

### ERR_ITEM_NOT_FOUND

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

### ERR_JID_MALFORMED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

### ERR_NOT_ACCEPTABLE

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

### ERR_NOT_ALLOWED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

### ERR_NOT_AUTHORIZED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

### ERR_PAYMENT_REQUIRED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

### ERR_RECIPIENT_UNAVAILABLE

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

### ERR_REGISTRATION_REQUIRED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

### ERR_REMOTE_SERVER_NOT_FOUND

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

### ERR_REMOTE_SERVER_TIMEOUT

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

### ERR_RESOURCE_CONSTRAINT

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

### ERR_SERVICE_UNAVAILABLE

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

### ERR_SUBSCRIPTION_REQUIRED

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

### ERR_UNDEFINED_CONDITION

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

### ERR_UNEXPECTED_REQUEST

Value:

      'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

### SASL_INCORRECT_ENCODING

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

### SASL_INVALID_AUTHZID

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

### SASL_INVALID_MECHANISM

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

### SASL_MECHANISM_TOO_WEAK

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

### SASL_NOT_AUTHORIZED

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

### SASL_TEMPORARY_AUTH_FAILURE

Value:

      'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

### STREAM_BAD_FORMAT

Value:

      'urn:ietf:params:xml:ns:xmpp-streams bad-format'

### STREAM_BAD_NAMESPACE_PREFIX

Value:

      'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

### STREAM_CONNECTION_TIMEOUT

Value:

      'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

### STREAM_HOST_GONE

Value:

      'urn:ietf:params:xml:ns:xmpp-streams host-gone'

### STREAM_HOST_UNKNOWN

Value:

      'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

### STREAM_IMPROPER_ADDRESSING

Value:

      'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

### STREAM_INTERNAL_SERVER_ERROR

Value:

      'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

### STREAM_INVALID_FROM

Value:

      'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

### STREAM_INVALID_ID

Value:

      'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

### STREAM_INVALID_NAMESPACE

Value:

      'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

### STREAM_INVALID_XML

Value:

      'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

### STREAM_NOT_AUTHORIZED

Value:

      'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

### STREAM_POLICY_VIOLATION

Value:

      'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

### STREAM_REMOTE_CONNECTION_FAILED

Value:

      'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

### STREAM_RESOURCE_CONSTRAINT

Value:

      'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

### STREAM_RESTRICTED_XML

Value:

      'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

### STREAM_SEE_OTHER_HOST

Value:

      'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

### STREAM_SYSTEM_SHUTDOWN

Value:

      'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

### STREAM_UNDEFINED_CONDITION

Value:

      'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

### STREAM_UNSUPPORTED_ENCODING

Value:

      'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

### STREAM_UNSUPPORTED_STANZA_TYPE

Value:

      'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

### STREAM_UNSUPPORTED_VERSION

Value:

      'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

### STREAM_XML_NOT_WELL_FORMED

Value:

      'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'