summaryrefslogtreecommitdiff
path: root/examples/s5b_transfer
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-19 17:47:26 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-19 17:47:26 +0100
commit9f6fa6513946e78de6e77a7e924fedc84c89ad25 (patch)
tree079a4f43a51cb7b4242c87aaa41810a30be11644 /examples/s5b_transfer
parent35fa33e3c232377acf77805d858a4efec54180ca (diff)
downloadslixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.gz
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.bz2
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.xz
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.zip
examples, tests: Replace all @asyncio.coroutines with proper async functions.
Diffstat (limited to 'examples/s5b_transfer')
-rwxr-xr-xexamples/s5b_transfer/s5b_sender.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/s5b_transfer/s5b_sender.py b/examples/s5b_transfer/s5b_sender.py
index 70a9704f..d729988e 100755
--- a/examples/s5b_transfer/s5b_sender.py
+++ b/examples/s5b_transfer/s5b_sender.py
@@ -36,8 +36,7 @@ class S5BSender(slixmpp.ClientXMPP):
# and the XML streams are ready for use.
self.add_event_handler("session_start", self.start)
- @asyncio.coroutine
- def start(self, event):
+ async def start(self, event):
"""
Process the session_start event.
@@ -53,14 +52,14 @@ class S5BSender(slixmpp.ClientXMPP):
try:
# Open the S5B stream in which to write to.
- proxy = yield from self['xep_0065'].handshake(self.receiver)
+ proxy = await self['xep_0065'].handshake(self.receiver)
# Send the entire file.
while True:
data = self.file.read(1048576)
if not data:
break
- yield from proxy.write(data)
+ await proxy.write(data)
# And finally close the stream.
proxy.transport.write_eof()