Package pyxmpp2 :: Module error :: Class ErrorElement
[hide private]

Class ErrorElement


Base class for both XMPP stream and stanza errors
Instance Methods [hide private]
 
__init__(self, element_or_cond, text=None, language=None)
Initialize an StanzaErrorElement object.
 
_from_xml(self, element)
Initialize an ErrorElement object from an XML element.
 
add_custom_condition(self, element)
Add custom condition element to the error.
unicode
serialize(self)
Serialize the stanza into a Unicode XML string.
ElementTree.Element
as_xml(self)
Return the XML error representation.

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

Class Variables [hide private]
  error_qname = '{unknown}error'
  text_qname = '{unknown}text'
  cond_qname_prefix = '{unknown}'
Instance Variables [hide private]
unicode condition
the condition element
list of ElementTree.Element custom_condition
list of custom condition elements
unicode language
xml:lang of the error element
unicode text
human-readable error description
Properties [hide private]
  condition_name
Return the condition name (condition element name without the namespace).

Inherited from object: __class__

Method Details [hide private]

__init__(self, element_or_cond, text=None, language=None)
(Constructor)

 
Initialize an StanzaErrorElement object.
Parameters:
  • element_or_cond (ElementTree.Element or unicode) - XML <error/> element to decode or an error condition name or element.
  • text (unicode) - optional description to override the default one
  • language (unicode) - RFC 3066 language tag for the description
Overrides: object.__init__

_from_xml(self, element)

 
Initialize an ErrorElement object from an XML element.
Parameters:

add_custom_condition(self, element)

 
Add custom condition element to the error.
Parameters:

serialize(self)

 
Serialize the stanza into a Unicode XML string.
Returns: unicode
serialized element.

Property Details [hide private]

condition_name

Return the condition name (condition element name without the namespace).
Get Method:
unreachable.condition_name(self) - Return the condition name (condition element name without the namespace).