* 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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user