When send runs through, also remove
This commit is contained in:
parent
724f665753
commit
f210bad620
@ -143,7 +143,7 @@ class DropShip:
|
||||
|
||||
async def send(self, fpath):
|
||||
self._send_spinner_on()
|
||||
code, scope = await self.nursery.start(wormhole_send, fpath)
|
||||
code, scope = await self.nursery.start(wormhole_send, fpath, self)
|
||||
self._create_pending_transfer(fpath, code, scope)
|
||||
self.clipboard.set_text(code, -1)
|
||||
self._send_spinner_off(code)
|
||||
|
@ -5,7 +5,7 @@ from trio import TASK_STATUS_IGNORED, CancelScope, open_process, run_process
|
||||
from dropship import log
|
||||
|
||||
|
||||
async def wormhole_send(fpath, task_status=TASK_STATUS_IGNORED):
|
||||
async def wormhole_send(fpath, parent, task_status=TASK_STATUS_IGNORED):
|
||||
"""Run `wormhole send` on a local file path."""
|
||||
with CancelScope() as scope:
|
||||
command = ["wormhole", "send", fpath]
|
||||
@ -21,6 +21,8 @@ async def wormhole_send(fpath, task_status=TASK_STATUS_IGNORED):
|
||||
process.terminate()
|
||||
log.info(f"wormhole_send: succesfully terminated process ({code})")
|
||||
|
||||
parent._remove_pending_transfer(code)
|
||||
|
||||
|
||||
async def wormhole_recv(code, parent, task_status=TASK_STATUS_IGNORED):
|
||||
"""Run `wormhole receive` on a pending transfer code."""
|
||||
|
Loading…
Reference in New Issue
Block a user