Home | Trees | Index | Help |
|
---|
Package pyxmpp :: Module stanza :: Class Stanza |
|
Iq
,
Message
,
Presence
Base class for all XMPP stanzas. :Ivariables: - `xmlnode`: stanza XML node. - `_error`: `pyxmpp.error.StanzaErrorNode` describing the error associated with the stanza of type "error". :Types: - `xmlnode`: `libxml2.xmlNode` - `_error`: `pyxmpp.error.StanzaErrorNode`
Method Summary | |
---|---|
Initialize a Stanza object. | |
__del__(self)
| |
__eq__(self,
other)
| |
__ne__(self,
other)
| |
Add an XML node to the stanza's payload. | |
Add a new XML element to the stanza payload. | |
Create a deep copy of the stanza. | |
Free the node associated with this `Stanza` object. | |
Get stanza error information. | |
Get "from" attribute of the stanza. | |
Get "from" attribute of the stanza. | |
Get "id" attribute of the stanza. | |
Return the XML node wrapped into `self`. | |
Get "id" attribute of the stanza. | |
Get "type" attribute of the stanza. | |
Get "to" attribute of the stanza. | |
Get "to" attribute of the stanza. | |
Get "type" attribute of the stanza. | |
Serialize the stanza into an UTF-8 encoded XML string. | |
Set stanza content to an XML node. | |
Set "from" attribute of the stanza. | |
Set "id" attribute of the stanza. | |
Set stanza payload to a new XML element. | |
Set "to" attribute of the stanza. | |
Set "type" attribute of the stanza. | |
Evaluate an XPath expression on the stanza XML node. |
Class Variable Summary | |
---|---|
str |
stanza_type = 'Unknown'
|
Method Details |
---|
__init__(self,
name_or_xmlnode,
from_jid=None,
to_jid=None,
stanza_type=None,
stanza_id=None,
error=None,
error_cond=None)
|
add_content(self, content)Add an XML node to the stanza's payload. :Parameters: - `content`: XML node to be added to the payload. :Types: - `content`: `libxml2.xmlNode` or UTF-8 `str` |
add_new_content(self, ns_uri, name)Add a new XML element to the stanza payload. :Parameters: - `ns_uri`: XML namespace URI of the element. - `name`: element name. :Types: - `ns_uri`: `str` - `name`: `str` or `unicode` |
copy(self)Create a deep copy of the stanza. :returntype: `Stanza` |
free(self)Free the node associated with this `Stanza` object. |
get_error(self)Get stanza error information. :return: object describing the error. :returntype: `pyxmpp.error.StanzaErrorNode` |
get_from(self)Get "from" attribute of the stanza. :return: value of the "from" attribute (sender JID) or None. :returntype: `unicode` |
get_from_jid(self)Get "from" attribute of the stanza. :return: value of the "from" attribute (sender JID) or None. :returntype: `unicode` |
get_id(self)Get "id" attribute of the stanza. :return: value of the "id" attribute (stanza identifier) or None. :returntype: `unicode` |
get_node(self)Return the XML node wrapped into `self`. :returntype: `libxml2.xmlNode` |
get_stanza_id(self)Get "id" attribute of the stanza. :return: value of the "id" attribute (stanza identifier) or None. :returntype: `unicode` |
get_stanza_type(self)Get "type" attribute of the stanza. :return: value of the "type" attribute (stanza type) or None. :returntype: `unicode` |
get_to(self)Get "to" attribute of the stanza. :return: value of the "to" attribute (recipient JID) or None. :returntype: `unicode` |
get_to_jid(self)Get "to" attribute of the stanza. :return: value of the "to" attribute (recipient JID) or None. :returntype: `unicode` |
get_type(self)Get "type" attribute of the stanza. :return: value of the "type" attribute (stanza type) or None. :returntype: `unicode` |
serialize(self)Serialize the stanza into an UTF-8 encoded XML string. :return: serialized stanza. :returntype: `str` |
set_content(self, content)Set stanza content to an XML node. :Parameters: - `content`: XML node to be included in the stanza. :Types: - `content`: `libxml2.xmlNode` or UTF-8 `str` |
set_from(self, from_jid)Set "from" attribute of the stanza. :Parameters: - `from_jid`: new value of the "from" attribute (sender JID). :Types: - `from_jid`: `unicode` |
set_id(self, stanza_id)Set "id" attribute of the stanza. :Parameters: - `stanza_id`: new value of the "id" attribute (stanza identifier). :Types: - `stanza_id`: `unicode` |
set_new_content(self, ns_uri, name)Set stanza payload to a new XML element. :Parameters: - `ns_uri`: XML namespace URI of the element. - `name`: element name. :Types: - `ns_uri`: `str` - `name`: `str` or `unicode` |
set_to(self, to_jid)Set "to" attribute of the stanza. :Parameters: - `to_jid`: new value of the "to" attribute (recipient JID). :Types: - `to_jid`: `unicode` |
set_type(self, stanza_type)Set "type" attribute of the stanza. :Parameters: - `stanza_type`: new value of the "type" attribute (stanza type). :Types: - `stanza_type`: `unicode` |
xpath_eval(self, expr, namespaces=None)Evaluate an XPath expression on the stanza XML node. The expression will be evaluated in context where the common namespace (the one used for stanza elements, mapped to 'jabber:client', 'jabber:server', etc.) is bound to prefix "ns" and other namespaces are bound accordingly to the `namespaces` list. :Parameters: - `expr`: XPath expression. - `namespaces`: mapping from namespace prefixes to URIs. :Types: - `expr`: `unicode` - `namespaces`: `dict` or other mapping |
Class Variable Details |
---|
stanza_type
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Wed May 31 22:36:58 2006 | http://epydoc.sf.net |