aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot2014-08-16 20:37:29 (GMT)
committerFlorent Le Coz2014-09-01 00:42:45 (GMT)
commit476d76a53301f9da2ac7efa094e209b0607adfdc (patch)
tree0307c1205944027fe79eab66d2b7ec293ed31238
parentdf68bb48961574436c1ffc2463a31cd7d8227606 (diff)
downloadslixmpp-476d76a53301f9da2ac7efa094e209b0607adfdc.tar.gz
slixmpp-476d76a53301f9da2ac7efa094e209b0607adfdc.tar.xz
Remove threaded from examples’ add_event_handler.
-rwxr-xr-xexamples/custom_stanzas/custom_stanza_provider.py7
-rwxr-xr-xexamples/custom_stanzas/custom_stanza_user.py2
-rwxr-xr-xexamples/disco_browser.py2
-rwxr-xr-xexamples/download_avatars.py2
-rwxr-xr-xexamples/ibb_transfer/ibb_receiver.py2
-rwxr-xr-xexamples/ping.py2
-rwxr-xr-xexamples/pubsub_client.py2
-rwxr-xr-xexamples/register_account.py4
-rwxr-xr-xexamples/roster_browser.py6
-rwxr-xr-xexamples/send_client.py2
-rwxr-xr-xexamples/set_avatar.py2
-rwxr-xr-xexamples/user_location.py2
12 files changed, 14 insertions, 21 deletions
diff --git a/examples/custom_stanzas/custom_stanza_provider.py b/examples/custom_stanzas/custom_stanza_provider.py
index 5782b67..b1b6e0a 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 2172219..af6bf9b 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)
diff --git a/examples/disco_browser.py b/examples/disco_browser.py
index b088fdc..11ea2e3 100755
--- a/examples/disco_browser.py
+++ b/examples/disco_browser.py
@@ -51,7 +51,7 @@ class Disco(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)
def start(self, event):
"""
diff --git a/examples/download_avatars.py b/examples/download_avatars.py
index dc35df8..fc89317 100755
--- a/examples/download_avatars.py
+++ b/examples/download_avatars.py
@@ -33,7 +33,7 @@ class AvatarDownloader(slixmpp.ClientXMPP):
def __init__(self, jid, password):
slixmpp.ClientXMPP.__init__(self, jid, password)
- self.add_event_handler("session_start", self.start, threaded=True)
+ self.add_event_handler("session_start", self.start)
self.add_event_handler("changed_status", self.wait_for_presences)
self.add_event_handler('vcard_avatar_update', self.on_vcard_avatar)
diff --git a/examples/ibb_transfer/ibb_receiver.py b/examples/ibb_transfer/ibb_receiver.py
index dd9171d..d24e500 100755
--- a/examples/ibb_transfer/ibb_receiver.py
+++ b/examples/ibb_transfer/ibb_receiver.py
@@ -37,7 +37,7 @@ class IBBReceiver(slixmpp.ClientXMPP):
# our roster.
self.add_event_handler("session_start", self.start)
- self.add_event_handler("ibb_stream_start", self.stream_opened, threaded=True)
+ self.add_event_handler("ibb_stream_start", self.stream_opened)
self.add_event_handler("ibb_stream_data", self.stream_data)
def start(self, event):
diff --git a/examples/ping.py b/examples/ping.py
index 85cf722..25aaf98 100755
--- a/examples/ping.py
+++ b/examples/ping.py
@@ -34,7 +34,7 @@ class PingTest(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)
def start(self, event):
"""
diff --git a/examples/pubsub_client.py b/examples/pubsub_client.py
index 3b413e2..7fdd227 100755
--- a/examples/pubsub_client.py
+++ b/examples/pubsub_client.py
@@ -28,7 +28,7 @@ class PubsubClient(slixmpp.ClientXMPP):
self.data = data
self.pubsub_server = server
- self.add_event_handler('session_start', self.start, threaded=True)
+ self.add_event_handler('session_start', self.start)
def start(self, event):
self.get_roster()
diff --git a/examples/register_account.py b/examples/register_account.py
index 00bdfd0..17f672e 100755
--- a/examples/register_account.py
+++ b/examples/register_account.py
@@ -36,7 +36,7 @@ class RegisterBot(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)
# The register event provides an Iq result stanza with
# a registration form from the server. This may include
@@ -45,7 +45,7 @@ class RegisterBot(slixmpp.ClientXMPP):
# cases, you will need to examine the fields provided
# and respond accordingly. Slixmpp provides plugins
# for data forms and OOB links that will make that easier.
- self.add_event_handler("register", self.register, threaded=True)
+ self.add_event_handler("register", self.register)
def start(self, event):
"""
diff --git a/examples/roster_browser.py b/examples/roster_browser.py
index 785221d..6ca7ffe 100755
--- a/examples/roster_browser.py
+++ b/examples/roster_browser.py
@@ -31,10 +31,8 @@ class RosterBrowser(slixmpp.ClientXMPP):
# the bot establishes its connection with the server
# and the XML streams are ready for use. We want to
# listen for this event so that we we can initialize
- # our roster. We need threaded=True so that the
- # session_start handler doesn't block event processing
- # while we wait for presence stanzas to arrive.
- self.add_event_handler("session_start", self.start, threaded=True)
+ # our roster.
+ self.add_event_handler("session_start", self.start)
self.add_event_handler("changed_status", self.wait_for_presences)
self.received = set()
diff --git a/examples/send_client.py b/examples/send_client.py
index 60c589e..beecfac 100755
--- a/examples/send_client.py
+++ b/examples/send_client.py
@@ -36,7 +36,7 @@ class SendMsgBot(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)
def start(self, event):
"""
diff --git a/examples/set_avatar.py b/examples/set_avatar.py
index e687e6e..12a79b3 100755
--- a/examples/set_avatar.py
+++ b/examples/set_avatar.py
@@ -29,7 +29,7 @@ class AvatarSetter(slixmpp.ClientXMPP):
def __init__(self, jid, password, filepath):
slixmpp.ClientXMPP.__init__(self, jid, password)
- self.add_event_handler("session_start", self.start, threaded=True)
+ self.add_event_handler("session_start", self.start)
self.filepath = filepath
diff --git a/examples/user_location.py b/examples/user_location.py
index 5fa4f56..7fa77e6 100755
--- a/examples/user_location.py
+++ b/examples/user_location.py
@@ -24,7 +24,7 @@ class LocationBot(ClientXMPP):
def __init__(self, jid, password):
super(LocationBot, self).__init__(jid, password)
- self.add_event_handler('session_start', self.start, threaded=True)
+ self.add_event_handler('session_start', self.start)
self.add_event_handler('user_location_publish',
self.user_location_publish)