This commit is contained in:
randogoth 2023-06-08 02:09:27 +03:00
parent 35231aa55b
commit edf5776b06
3 changed files with 6 additions and 5 deletions

View file

@ -160,8 +160,8 @@ class OrvaniTag:
self.__cd(target.parent)
if fop:
target.unlink(missing_ok=True)
if file in self.DB:
del self.DB[file]
if target.name in self.DB:
del self.DB[target.name]
if not self.DB:
Path(self.FILE).unlink(missing_ok=True)
self.__save()
@ -188,7 +188,7 @@ class OrvaniTag:
if self.DB[sourcefile]:
sourcedata = self.DB[sourcefile]
if not retain:
self.purge(source)
self.delete(source)
self.__cd(destfolder)
self.DB.update( { destfile : sourcedata } )
self.__save()
@ -209,10 +209,11 @@ class OrvaniTag:
path = '.'
target = Path(path)
if target.exists():
self.__cd(target.parent)
self.__cd(path)
DB = self.DB.copy()
for file in self.DB.keys():
if not Path(file).is_file():
f = target / file
if not f.is_file():
if file in self.DB:
del DB[file]
self.DB = DB