Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Jajcus/pyxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pyxmpp
diff options
context:
space:
mode:
authorJacek Konieczny <jajcus@jajcus.net>2007-02-21 12:18:13 +0300
committerJacek Konieczny <jajcus@jajcus.net>2007-02-21 12:18:13 +0300
commit105b9f10477b6f36d830bb612cae08f01a155899 (patch)
tree1d6d405b8615be5e852c93a07fde2c9bf0d859a9 /pyxmpp
parentdc8f08812c176236f443a40bfffc91a9bd5ca9d8 (diff)
- as_xml() already adds content to the stanza ('if' changed to 'elif')
Diffstat (limited to 'pyxmpp')
-rw-r--r--pyxmpp/stanza.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pyxmpp/stanza.py b/pyxmpp/stanza.py
index 562a030..a1cb765 100644
--- a/pyxmpp/stanza.py
+++ b/pyxmpp/stanza.py
@@ -294,11 +294,12 @@ class Stanza:
:Parameters:
- `content`: XML node to be added to the payload.
:Types:
- - `content`: `libxml2.xmlNode` or UTF-8 `str`
+ - `content`: `libxml2.xmlNode`, UTF-8 `str` or an object with
+ "as_xml()" method.
"""
- if hasattr(content,"as_xml"):
- content.as_xml(parent=self.xmlnode,doc=common_doc)
- if isinstance(content,libxml2.xmlNode):
+ if hasattr(content, "as_xml"):
+ content.as_xml(parent = self.xmlnode, doc = common_doc)
+ elif isinstance(content,libxml2.xmlNode):
self.xmlnode.addChild(content.docCopyNode(common_doc,1))
else:
self.xmlnode.addContent(content)