From a5227dd585846d4a130a31aec536408292028f54 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 11 Oct 2020 13:35:11 +0200 Subject: [PATCH] Use basename to get the filename --- dropship/dropship.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dropship/dropship.py b/dropship/dropship.py index 26bf025..4043ddc 100644 --- a/dropship/dropship.py +++ b/dropship/dropship.py @@ -1,3 +1,4 @@ +from os.path import basename from pathlib import Path from subprocess import PIPE @@ -95,13 +96,13 @@ class DropShip: self.files_to_send = files if len(files) == 1: fpath = files[0].replace("file://", "") + fname = basename(fpath) # TODO Luke can u make a callback that spawns pendingTransmissions after we got a code? self.nursery.start_soon(self.wormhole_send, fpath) # TODO Roel/Luke, move this somewhere logical in its own function? - status = pendingTransferRow( - self, fpath.split("/")[-1], self.transfer_code - ) + status = pendingTransferRow(self, fname, self.transfer_code) + # TODO Roel, find out how to add to a listbox self.pending_transfers_list.insert( status, -1