diff options
author | Nathan Fritz <nathan@andyet.net> | 2011-08-10 13:37:49 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2011-08-10 13:37:49 -0700 |
commit | a189cb8333d5f59caa9015f0ded222696987d957 (patch) | |
tree | 467f202bc7f85a4cde85a5add3c372515f18adc3 /sleekxmpp/xmlstream/stanzabase.py | |
parent | 0d4825d3ea0562f305939e653e3d414e70e4aaa8 (diff) | |
parent | 156b3200e3b5ad1b2e64eecc48cdc792f7b2ffd9 (diff) | |
download | slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.gz slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.bz2 slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.xz slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.zip |
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r-- | sleekxmpp/xmlstream/stanzabase.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index d9a4636a..a2826ead 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -482,7 +482,8 @@ class ElementBase(object): if plugin: if plugin not in self.plugins: self.init_plugin(plugin) - handler = getattr(self.plugins[plugin], set_method, None) + handler = getattr(self.plugins[plugin], + set_method, None) if handler: return handler(value) @@ -1064,7 +1065,9 @@ class ElementBase(object): Defaults to True. """ stanza_ns = '' if top_level_ns else self.namespace - return tostring(self.xml, xmlns='', stanza_ns=stanza_ns) + return tostring(self.xml, xmlns='', + stanza_ns=stanza_ns, + top_level=not top_level_ns) def __repr__(self): """ @@ -1282,7 +1285,8 @@ class StanzaBase(ElementBase): stanza_ns = '' if top_level_ns else self.namespace return tostring(self.xml, xmlns='', stanza_ns=stanza_ns, - stream=self.stream) + stream=self.stream, + top_level=not top_level_ns) # To comply with PEP8, method names now use underscores. |