summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/disco_browser.py6
-rwxr-xr-xexamples/download_avatars.py4
-rwxr-xr-xexamples/register_account.py2
-rwxr-xr-xexamples/set_avatar.py6
4 files changed, 8 insertions, 10 deletions
diff --git a/examples/disco_browser.py b/examples/disco_browser.py
index 796562f2..783156b8 100755
--- a/examples/disco_browser.py
+++ b/examples/disco_browser.py
@@ -82,15 +82,13 @@ class Disco(slixmpp.ClientXMPP):
# for the disco_info event, or passing a handler
# function using the callback parameter.
info = yield from self['xep_0030'].get_info(jid=self.target_jid,
- node=self.target_node,
- coroutine=True)
+ node=self.target_node)
if self.get in self.items_types:
# The same applies from above. Listen for the
# disco_items event or pass a callback function
# if you need to process a non-blocking request.
items = yield from self['xep_0030'].get_items(jid=self.target_jid,
- node=self.target_node,
- coroutine=True)
+ node=self.target_node)
if self.get not in self.info_types and self.get not in self.items_types:
logging.error("Invalid disco request type.")
return
diff --git a/examples/download_avatars.py b/examples/download_avatars.py
index 1d7d72f8..408c2146 100755
--- a/examples/download_avatars.py
+++ b/examples/download_avatars.py
@@ -75,7 +75,7 @@ class AvatarDownloader(slixmpp.ClientXMPP):
print("Received vCard avatar update from %s" % pres['from'].bare)
try:
result = yield from self['xep_0054'].get_vcard(pres['from'].bare, cached=True,
- coroutine=True, timeout=5)
+ timeout=5)
except XMPPError:
print("Error retrieving avatar for %s" % pres['from'])
return
@@ -97,7 +97,7 @@ class AvatarDownloader(slixmpp.ClientXMPP):
if not info['url']:
try:
result = yield from self['xep_0084'].retrieve_avatar(msg['from'].bare, info['id'],
- coroutine=True, timeout=5)
+ timeout=5)
except XMPPError:
print("Error retrieving avatar for %s" % msg['from'])
return
diff --git a/examples/register_account.py b/examples/register_account.py
index 1cfc8c72..8ec238e9 100755
--- a/examples/register_account.py
+++ b/examples/register_account.py
@@ -90,7 +90,7 @@ class RegisterBot(slixmpp.ClientXMPP):
resp['register']['password'] = self.password
try:
- yield from resp.send_coroutine()
+ yield from resp.send()
logging.info("Account created for %s!" % self.boundjid)
except IqError as e:
logging.error("Could not register account: %s" %
diff --git a/examples/set_avatar.py b/examples/set_avatar.py
index 5805d18a..f9641b1e 100755
--- a/examples/set_avatar.py
+++ b/examples/set_avatar.py
@@ -68,14 +68,14 @@ class AvatarSetter(slixmpp.ClientXMPP):
used_xep84 = False
print('Publish XEP-0084 avatar data')
- result = yield from self['xep_0084'].publish_avatar(avatar, coroutine=True)
+ result = yield from self['xep_0084'].publish_avatar(avatar)
if isinstance(result, XMPPError):
print('Could not publish XEP-0084 avatar')
else:
used_xep84 = True
print('Update vCard with avatar')
- result = yield from self['xep_0153'].set_avatar(avatar=avatar, mtype=avatar_type, coroutine=True)
+ result = yield from self['xep_0153'].set_avatar(avatar=avatar, mtype=avatar_type)
if isinstance(result, XMPPError):
print('Could not set vCard avatar')
@@ -89,7 +89,7 @@ class AvatarSetter(slixmpp.ClientXMPP):
# options in image type, source (HTTP vs pubsub),
# size, etc.
# {'id': ....}
- ], coroutine=True)
+ ])
if isinstance(result, XMPPError):
print('Could not publish XEP-0084 metadata')