Browse Source

Use basename to get the filename

unifiedWindowUI
Luke Murphy 4 years ago
parent
commit
a5227dd585
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 7
      dropship/dropship.py

7
dropship/dropship.py

@ -1,3 +1,4 @@
from os.path import basename
from pathlib import Path from pathlib import Path
from subprocess import PIPE from subprocess import PIPE
@ -95,13 +96,13 @@ class DropShip:
self.files_to_send = files self.files_to_send = files
if len(files) == 1: if len(files) == 1:
fpath = files[0].replace("file://", "") fpath = files[0].replace("file://", "")
fname = basename(fpath)
# TODO Luke can u make a callback that spawns pendingTransmissions after we got a code? # TODO Luke can u make a callback that spawns pendingTransmissions after we got a code?
self.nursery.start_soon(self.wormhole_send, fpath) self.nursery.start_soon(self.wormhole_send, fpath)
# TODO Roel/Luke, move this somewhere logical in its own function? # TODO Roel/Luke, move this somewhere logical in its own function?
status = pendingTransferRow( status = pendingTransferRow(self, fname, self.transfer_code)
self, fpath.split("/")[-1], self.transfer_code
)
# TODO Roel, find out how to add to a listbox # TODO Roel, find out how to add to a listbox
self.pending_transfers_list.insert( self.pending_transfers_list.insert(
status, -1 status, -1

Loading…
Cancel
Save