From abd62d4d6e0499b6106af812333244b24803ad5f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 18 Nov 2019 13:16:21 +0000 Subject: [PATCH] Remove paths from index --- inbox.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inbox.py b/inbox.py index de85f5a28..243ee9cbd 100644 --- a/inbox.py +++ b/inbox.py @@ -1576,8 +1576,14 @@ def inboxUpdateIndex(boxname: str,baseDir: str,handle: str,destinationFilename: indexFilename=baseDir+'/accounts/'+handle+'/'+boxname+'.index' if debug: print('DEBUG: Updating index '+indexFilename) + if '/'+boxname+'/' in destinationFilename: destinationFilename=destinationFilename.split('/'+boxname+'/')[1] + + # remove the path + if '/' in destinationFilename: + destinationFilename=destinationFilename.split('/')[-1] + if os.path.isfile(indexFilename): try: with open(indexFilename, 'r+') as indexFile: