Clean up old json files

This commit is contained in:
Veronica K. B. Olsen
2020-02-19 19:57:08 +01:00
parent 5f0b331655
commit 4977ffd843
2 changed files with 16 additions and 4 deletions
-4
View File
@@ -26,10 +26,6 @@ class nwFiles():
SESS_INFO = "sessionInfo.log"
INDEX_FILE = "tagsIndex.json"
OPTS_FILE = "guiOptions.json"
EXPORT_OPT = "exportOptions.json"
TLINE_OPT = "timelineOptions.json"
SLOG_OPT = "sessionLogOptions.json"
MERGE_OPT = "docMergeOptions.json"
# END Class nwFiles
+16
View File
@@ -44,4 +44,20 @@ def projectMaintenance(theProject):
except Exception as e:
logger.error(str(e))
# Remove no longer used meta files
rmList = []
rmList.append(path.join(theProject.projMeta, "mainOptions.json"))
rmList.append(path.join(theProject.projMeta, "exportOptions.json"))
rmList.append(path.join(theProject.projMeta, "outlineOptions.json"))
rmList.append(path.join(theProject.projMeta, "timelineOptions.json"))
rmList.append(path.join(theProject.projMeta, "docMergeOptions.json"))
rmList.append(path.join(theProject.projMeta, "sessionLogOptions.json"))
for rmFile in rmList:
if path.isfile(rmFile):
logger.info("Deleting: %s" % rmFile)
try:
unlink(rmFile)
except Exception as e:
logger.error(str(e))
return