From 8e3168e145da563cc0cca9762ff0c78b65425b73 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Fri, 8 Jan 2010 01:45:11 +0000 Subject: * added first stanza tests * added stanza.keys() * stanza.getValues() now return substanzas and plugins * stanza.setValues() now can read substanzas and plugins * stanzas can now be iterable if stanza.subitem is set to a class --- sleekxmpp/stanza/iq.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sleekxmpp/stanza/iq.py') diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py index cec0f8bc..e3eccfdc 100644 --- a/sleekxmpp/stanza/iq.py +++ b/sleekxmpp/stanza/iq.py @@ -48,14 +48,14 @@ class Iq(RootStanza): def setQuery(self, value): query = self.xml.find("{%s}query" % value) - if query is None: + if query is None and value: self.clear() query = ET.Element("{%s}query" % value) self.xml.append(query) return self def getQuery(self): - for child in self.getchildren(): + for child in self.xml.getchildren(): if child.tag.endswith('query'): ns =child.tag.split('}')[0] if '{' in ns: -- cgit v1.2.3