Package nbxmpp :: Module protocol :: Class Protocol

[hide private]
[frames] | no frames]

# Class Protocol

source code

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. 'message' or 'presence'or 'iq' | 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

getTimestamp2(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

getErrorMsg(self) Return the textual description of the error (if present) or the error condition | source code

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

getStatusConditions(self) Return the status conditions list as defined in XEP-0306. | source code

setError(self, error, code=None) Set the error code. Obsolete. Use error-conditions instead | source code

setTimestamp(self, val=None) Set the timestamp. timestamp should be the yyyymmddThhmmss string | 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`: `__contains__`, `__delitem__`, `__getattr__`, `__getitem__`, `__str__`, `addChild`, `addData`, `clearData`, `delAttr`, `delChild`, `getAttr`, `getAttrs`, `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, 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: object.__init__

### getTo(self)

source code

Return value of the 'to' attribute

### getFrom(self)

source code

Return value of the 'from' attribute

### getTimestamp(self)

source code

Return the timestamp in the 'yyyymmddThhmmss' format

### getTimestamp2(self)

source code

Return the timestamp in the 'yyyymmddThhmmss' format

### getID(self)

source code

Return the value of the 'id' attribute

### setTo(self, val)

source code

Set the value of the 'to' attribute

### getType(self)

source code

Return the value of the 'type' attribute

### setFrom(self, val)

source code

Set the value of the 'from' attribute

### setType(self, val)

source code

Set the value of the 'type' attribute

### setID(self, val)

source code

Set the value of the 'id' attribute

### getError(self)

source code

Return the error-condition (if present) or the textual description of the error (otherwise)

### getErrorMsg(self)

source code

Return the textual description of the error (if present) or the error condition

### getErrorCode(self)

source code

Return the error code. Obsolete.

### getStatusConditions(self)

source code

Return the status conditions list as defined in XEP-0306.

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

source code

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

### setTimestamp(self, val=None)

source code

Set the timestamp. timestamp should be the yyyymmddThhmmss string

### getProperties(self)

source code

Return the list of namespaces to which belongs the direct childs of element

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

source code

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

Overrides: simplexml.Node.__setitem__