Remove paths from index

main
Bob Mottram 2019-11-18 13:16:21 +00:00
parent 084c5c0cc9
commit abd62d4d6e
1 changed files with 6 additions and 0 deletions

View File

@ -1576,8 +1576,14 @@ def inboxUpdateIndex(boxname: str,baseDir: str,handle: str,destinationFilename:
indexFilename=baseDir+'/accounts/'+handle+'/'+boxname+'.index' indexFilename=baseDir+'/accounts/'+handle+'/'+boxname+'.index'
if debug: if debug:
print('DEBUG: Updating index '+indexFilename) print('DEBUG: Updating index '+indexFilename)
if '/'+boxname+'/' in destinationFilename: if '/'+boxname+'/' in destinationFilename:
destinationFilename=destinationFilename.split('/'+boxname+'/')[1] destinationFilename=destinationFilename.split('/'+boxname+'/')[1]
# remove the path
if '/' in destinationFilename:
destinationFilename=destinationFilename.split('/')[-1]
if os.path.isfile(indexFilename): if os.path.isfile(indexFilename):
try: try:
with open(indexFilename, 'r+') as indexFile: with open(indexFilename, 'r+') as indexFile: