summaryrefslogtreecommitdiff
path: root/examples/disco_browser.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/disco_browser.py')
-rwxr-xr-xexamples/disco_browser.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/disco_browser.py b/examples/disco_browser.py
index a9e8711f..f0ece32d 100755
--- a/examples/disco_browser.py
+++ b/examples/disco_browser.py
@@ -15,7 +15,6 @@ from argparse import ArgumentParser
import slixmpp
from slixmpp.exceptions import IqError, IqTimeout
-from slixmpp.xmlstream.asyncio import asyncio
class Disco(slixmpp.ClientXMPP):
@@ -54,8 +53,7 @@ class Disco(slixmpp.ClientXMPP):
# our roster.
self.add_event_handler("session_start", self.start)
- @asyncio.coroutine
- def start(self, event):
+ async def start(self, event):
"""
Process the session_start event.
@@ -77,13 +75,13 @@ class Disco(slixmpp.ClientXMPP):
try:
if self.get in self.info_types:
# function using the callback parameter.
- info = yield from self['xep_0030'].get_info(jid=self.target_jid,
+ info = await self['xep_0030'].get_info(jid=self.target_jid,
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,
+ items = await self['xep_0030'].get_items(jid=self.target_jid,
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.")