Package xmpp :: Module protocol :: Class Iq
[hide private]
[frames] | no frames]

Class Iq

source code


XMPP Iq object - get/set dialog mechanism.

Instance Methods [hide private]
 
__init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns='jabber:client', node=None)
Create Iq object.
source code
 
getQuery(self)
Return the IQ's child element if it exists, None otherwise.
source code
 
getQueryNS(self)
Return the namespace of the 'query' child element.
source code
 
getQuerynode(self)
Return the 'node' attribute value of the 'query' child element.
source code
 
getQueryPayload(self)
Return the 'query' child element payload.
source code
 
getQueryChildren(self)
Return the 'query' child element child nodes.
source code
 
setQuery(self, name=None)
Change the name of the query node, creating it if needed.
source code
 
setQueryNS(self, namespace)
Set the namespace of the 'query' child element.
source code
 
setQueryPayload(self, payload)
Set the 'query' child element payload.
source code
 
setQuerynode(self, node)
Set the 'node' attribute value of the 'query' child element.
source code
 
buildReply(self, typ)
Builds and returns another Iq object of specified type.
source code

Inherited from Protocol: __setitem__, getError, getErrorCode, getFrom, getID, getProperties, getTimestamp, getTo, getType, setError, setFrom, setID, setTimestamp, setTo, setType

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, iterTags, lookup_nsp, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns='jabber:client', node=None)
(Constructor)

source code 

Create Iq object. You can specify type, query namespace any additional attributes, recipient of the iq, sender of the iq, any additional payload (f.e. jabber:x:data node) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as an iq.

Overrides: object.__init__

setQuery(self, name=None)

source code 

Change the name of the query node, creating it if needed. Keep the existing name if none is given (use 'query' if it's a creation). Return the query node.

buildReply(self, typ)

source code 

Builds and returns another Iq object of specified type. The to, from and query child node of new Iq are pre-set as reply to this Iq.