root/adventure/xmpp_error.py
| Revision 118, 398 bytes (checked in by elghinn, 11 months ago) |
|---|
| Line | |
|---|---|
| 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | from xmpp import Error as xmpp_error, Node, NS_STANZAS |
| 4 | |
| 5 | class Error(xmpp_error): |
| 6 | def __init__(self, node, error, text=None): |
| 7 | xmpp_error.__init__(self, node, error) |
| 8 | error_node = self.getTag('error') |
| 9 | error_node.getChildren()[0].setNamespace(NS_STANZAS) |
| 10 | if text: |
| 11 | error_node.addChild(node=Node(NS_STANZAS + ' text', {}, [text])) |
Note: See TracBrowser for help on using the browser.
