diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-05-28 19:19:28 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-05-28 19:19:28 -0700 |
commit | 2f1ba368e2adbac27434f70753a6497c0a257301 (patch) | |
tree | 0893bff04c68b654d48e78704012d12eeb658f85 /sleekxmpp/xmlstream/xmlstream.py | |
parent | bde181840024716e233881a4319daaaeab1555f0 (diff) | |
download | slixmpp-2f1ba368e2adbac27434f70753a6497c0a257301.tar.gz slixmpp-2f1ba368e2adbac27434f70753a6497c0a257301.tar.bz2 slixmpp-2f1ba368e2adbac27434f70753a6497c0a257301.tar.xz slixmpp-2f1ba368e2adbac27434f70753a6497c0a257301.zip |
control-c fixes
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 7fbc5f9e..6b92abca 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -76,7 +76,7 @@ class XMLStream(object): self.eventqueue = queue.Queue() self.sendqueue = queue.Queue() - self.scheduler = scheduler.Scheduler() + self.scheduler = scheduler.Scheduler(self.eventqueue) self.namespace_map = {} @@ -149,6 +149,7 @@ class XMLStream(object): def process(self, threaded=True): self.scheduler.process(threaded=True) for t in range(0, HANDLER_THREADS): + logging.debug("Starting HANDLER THREAD") self.__thread['eventhandle%s' % t] = threading.Thread(name='eventhandle%s' % t, target=self._eventRunner) self.__thread['eventhandle%s' % t].start() self.__thread['sendthread'] = threading.Thread(name='sendthread', target=self._sendThread) @@ -331,6 +332,9 @@ class XMLStream(object): event = self.eventqueue.get(True, timeout=5) except queue.Empty: event = None + except KeyboardInterrupt: + self.run = False + self.scheduler.run = False if event is not None: etype = event[0] handler = event[1] |