From 476d76a53301f9da2ac7efa094e209b0607adfdc Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 16 Aug 2014 22:37:29 +0200 Subject: =?UTF-8?q?Remove=20threaded=20from=20examples=E2=80=99=20add=5Fev?= =?UTF-8?q?ent=5Fhandler.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/custom_stanzas/custom_stanza_provider.py | 7 +------ examples/custom_stanzas/custom_stanza_user.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'examples/custom_stanzas') diff --git a/examples/custom_stanzas/custom_stanza_provider.py b/examples/custom_stanzas/custom_stanza_provider.py index 5782b671..b1b6e0a9 100755 --- a/examples/custom_stanzas/custom_stanza_provider.py +++ b/examples/custom_stanzas/custom_stanza_provider.py @@ -46,8 +46,7 @@ class ActionBot(slixmpp.ClientXMPP): self._handle_action)) self.add_event_handler('custom_action', - self._handle_action_event, - threaded=True) + self._handle_action_event) register_stanza_plugin(Iq, Action) @@ -77,10 +76,6 @@ class ActionBot(slixmpp.ClientXMPP): def _handle_action_event(self, iq): """ Respond to the custom action event. - - Since one of the actions is to disconnect, this - event handler needs to be run in threaded mode, by - using `threaded=True` in the `add_event_handler` call. """ method = iq['action']['method'] param = iq['action']['param'] diff --git a/examples/custom_stanzas/custom_stanza_user.py b/examples/custom_stanzas/custom_stanza_user.py index 21722196..af6bf9b3 100755 --- a/examples/custom_stanzas/custom_stanza_user.py +++ b/examples/custom_stanzas/custom_stanza_user.py @@ -38,7 +38,7 @@ class ActionUserBot(slixmpp.ClientXMPP): # and the XML streams are ready for use. We want to # listen for this event so that we we can initialize # our roster. - self.add_event_handler("session_start", self.start, threaded=True) + self.add_event_handler("session_start", self.start) self.add_event_handler("message", self.message) register_stanza_plugin(Iq, Action) -- cgit v1.2.3