Package xmpp :: Module protocol :: Class Protocol

[hide private]
[frames] | no frames]

# Class Protocol

source code

    simplexml.Node --+
                     |
                    Protocol

Known Subclasses:
  Error, Iq, Message, Presence

A "stanza" object class. Contains methods that are common for presences, iqs and messages.

Instance Methods | [hide private]

__init__(self, name=None, to=None, typ=None, frm=None, attrs=`{``}`, payload=`[``]`, timestamp=None, xmlns=None, node=None) Constructor, name is the name of the stanza i.e. | source code

getTo(self) Return value of the 'to' attribute. | source code

getFrom(self) Return value of the 'from' attribute. | source code

getTimestamp(self) Return the timestamp in the 'yyyymmddThhmmss' format. | source code

getID(self) Return the value of the 'id' attribute. | source code

setTo(self, val) Set the value of the 'to' attribute. | source code

getType(self) Return the value of the 'type' attribute. | source code

setFrom(self, val) Set the value of the 'from' attribute. | source code

setType(self, val) Set the value of the 'type' attribute. | source code

setID(self, val) Set the value of the 'id' attribute. | source code

getError(self) Return the error-condition (if present) or the textual description of the error (otherwise). | source code

getErrorCode(self) Return the error code. | source code

setError(self, error, code=None) Set the error code. | source code

setTimestamp(self, val=None) Set the timestamp. | source code

getProperties(self) Return the list of namespaces to which belongs the direct childs of element | source code

__setitem__(self, item, val) Set the item 'item' to the value 'val'. | source code

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`, `setAttr`, `setData`, `setName`, `setNamespace`, `setParent`, `setPayload`, `setTag`, `setTagAttr`, `setTagData`

Class Variables | [hide private]

Inherited from `simplexml.Node`: `FORCE_NODE_RECREATION`

Method Details | [hide private]

### __init__(self, name=None, to=None, typ=None, frm=None, attrs=`{``}`, payload=`[``]`, timestamp=None, xmlns=None, node=None)
(Constructor)

source code

Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'. to is the value of 'to' attribure, 'typ' - 'type' attribute frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition timestamp - the time value that needs to be stamped over stanza xmlns - namespace of top stanza node node - parsed or unparsed stana to be taken as prototype.

Overrides: simplexml.Node.__init__

### getErrorCode(self)

source code

Return the error code. Obsolette.

### setError(self, error, code=None)

source code

Set the error code. Obsolette. Use error-conditions instead.

### setTimestamp(self, val=None)

source code

Set the timestamp. timestamp should be the yyyymmddThhmmss string.

### __setitem__(self, item, val)
(Index assignment operator)

source code

Set the item 'item' to the value 'val'.

Overrides: simplexml.Node.__setitem__