summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
committerNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
commit18e27d65ce47d877d6b2c810979df640aba7d8ba (patch)
tree942ed2d45a54e830d6e7c005e3f872c480477866 /sleekxmpp/xmlstream/stanzabase.py
parent0c39567f208db4938614e9723901037d8801fb25 (diff)
parentaa916c9ac893a976c8e26ee07ca4a9768a5e1680 (diff)
downloadslixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.gz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.bz2
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.xz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 3f3f5e08..64020c8f 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -78,6 +78,9 @@ class ElementBase(tostring.ToString):
def __iter__(self):
self.idx = 0
return self
+
+ def __bool__(self):
+ return True
def __next__(self):
self.idx += 1
@@ -319,6 +322,8 @@ class StanzaBase(ElementBase):
def __init__(self, stream=None, xml=None, stype=None, sto=None, sfrom=None, sid=None):
self.stream = stream
+ if stream is not None:
+ self.namespace = stream.default_ns
ElementBase.__init__(self, xml)
if stype is not None:
self['type'] = stype
@@ -326,8 +331,6 @@ class StanzaBase(ElementBase):
self['to'] = sto
if sfrom is not None:
self['from'] = sfrom
- if stream is not None:
- self.namespace = stream.default_ns
self.tag = "{%s}%s" % (self.namespace, self.name)
def setType(self, value):