summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-05-27 19:58:57 +0800
committerThom Nichols <tmnichols@gmail.com>2010-06-01 22:07:52 +0800
commit194e6bcb5149f145c389fa8837dbe902557d9215 (patch)
tree9833402892ca0d1f738fc321cfb3c084da590854 /sleekxmpp/xmlstream/xmlstream.py
parent2e7024419a98e0dc69493010faf24b4a2c88d37e (diff)
downloadslixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.gz
slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.bz2
slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.xz
slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.zip
added pubsub state stanzas and scheduled events
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 3f0ab182..006f3876 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -180,6 +180,7 @@ class XMLStream(object):
self.state.set('reconnect', False)
self.disconnect()
self.run = False
+ self.scheduler.run = False
self.eventqueue.put(('quit', None, None))
return
except CloseStream:
@@ -228,6 +229,7 @@ class XMLStream(object):
edepth += -1
if edepth == 0 and event == b'end':
self.disconnect(reconnect=self.state['reconnect'])
+ logging.debug("Ending readXML loop")
return False
elif edepth == 1:
#self.xmlin.put(xmlobj)
@@ -236,11 +238,13 @@ class XMLStream(object):
except RestartStream:
return True
except CloseStream:
+ logging.debug("Ending readXML loop")
return False
if root:
root.clear()
if event == b'start':
edepth += 1
+ logging.debug("Ending readXML loop")
def _sendThread(self):
while self.run:
@@ -270,6 +274,7 @@ class XMLStream(object):
logging.debug("Disconnecting...")
self.state.set('disconnecting', True)
self.run = False
+ self.scheduler.run = False
if self.state['connected']:
self.sendRaw(self.stream_footer)
time.sleep(1)
@@ -341,7 +346,8 @@ class XMLStream(object):
args[0].exception(e)
elif etype == 'schedule':
try:
- handler.run(*args)
+ logging.debug(args)
+ handler(*args[0])
except:
logging.error(traceback.format_exc())
elif etype == 'quit':