From 2921d4aa4d2e4833a5dc1f7643487ea860d4c463 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 23 Jul 2020 12:40:50 +0200 Subject: [PATCH] Add recv place holder --- dropship.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dropship.py b/dropship.py index aad3948..1ef2f7d 100644 --- a/dropship.py +++ b/dropship.py @@ -40,6 +40,8 @@ class DropShip: self.GLADE_FILE = "dropship.glade" self.CSS_FILE = "dropship.css" + self.DOWNLOAD_DIR = os.path.expanduser("~") + self._running = loop.create_future() self._pending = [] @@ -132,7 +134,20 @@ class DropShip: self._pending.append(PendingTransfer(code)) - # TODO(decentral1se): waits forever... + await process.wait() + + + async def wormhole_recv(self, widget, code): + """Run `wormhole receive` with a pending transfer code.""" + process = await asyncio.create_subprocess_exec( + "wormhole", + "receive", + "--accept-file", + "--hide-progress", + code, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) await process.wait()