Add recv place holder

This commit is contained in:
Luke Murphy 2020-07-23 12:40:50 +02:00
parent 91354a3b37
commit 2921d4aa4d
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -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()