summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/iq.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-02-14 01:24:09 -0800
committerLance Stout <lancestout@gmail.com>2013-02-14 01:24:09 -0800
commitd8c96623022835dece47e499245369aa68927300 (patch)
treefe1f2604f5b90e345a74144e3fc63f782dd728e3 /sleekxmpp/stanza/iq.py
parentec5e819b16e5326638551b80464c0c3714b3dc3c (diff)
downloadslixmpp-d8c96623022835dece47e499245369aa68927300.tar.gz
slixmpp-d8c96623022835dece47e499245369aa68927300.tar.bz2
slixmpp-d8c96623022835dece47e499245369aa68927300.tar.xz
slixmpp-d8c96623022835dece47e499245369aa68927300.zip
Resolve most Python3.3 related issues.
Tests now run successfully. Occasionally get single error related to duplicated payload data in pubsub items when copying stanza values.
Diffstat (limited to 'sleekxmpp/stanza/iq.py')
-rw-r--r--sleekxmpp/stanza/iq.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py
index 71c0444d..ba945e08 100644
--- a/sleekxmpp/stanza/iq.py
+++ b/sleekxmpp/stanza/iq.py
@@ -115,9 +115,13 @@ class Iq(RootStanza):
"""
query = self.xml.find("{%s}query" % value)
if query is None and value:
- self.clear()
- query = ET.Element("{%s}query" % value)
- self.xml.append(query)
+ plugin = self.plugin_tag_map.get('{%s}query' % value, None)
+ if plugin:
+ self.enable(plugin.plugin_attrib)
+ else:
+ self.clear()
+ query = ET.Element("{%s}query" % value)
+ self.xml.append(query)
return self
def get_query(self):
@@ -182,8 +186,8 @@ class Iq(RootStanza):
the stanza immediately. Used during stream
initialization. Defaults to False.
timeout_callback -- Optional reference to a stream handler function.
- Will be executed when the timeout expires before a
- response has been received with the originally-sent IQ
+ Will be executed when the timeout expires before a
+ response has been received with the originally-sent IQ
stanza. Only called if there is a callback parameter
(and therefore are in async mode).
"""
@@ -194,10 +198,10 @@ class Iq(RootStanza):
if timeout_callback:
self.callback = callback
self.timeout_callback = timeout_callback
- self.stream.schedule('IqTimeout_%s' % self['id'],
- timeout,
- self._fire_timeout,
- repeat=False)
+ self.stream.schedule('IqTimeout_%s' % self['id'],
+ timeout,
+ self._fire_timeout,
+ repeat=False)
handler = Callback(handler_name,
MatcherId(self['id']),
self._handle_result,