From ca7617ad075444778b74d279a4bdc081ca4cae79 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 13 Feb 2020 19:07:51 +0100 Subject: [PATCH] Remove the project cache folder as it isn't, and was never really, needed --- nw/constants/constants.py | 1 - nw/project/project.py | 17 +++++------------ tests/test_gui.py | 2 -- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/nw/constants/constants.py b/nw/constants/constants.py index d3ccd1c7..f85f6558 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -22,7 +22,6 @@ class nwFiles(): APP_ICON = "novelWriter.svg" PROJ_FILE = "nwProject.nwx" - PROJ_COUNT = "projCount.txt" PROJ_DICT = "wordlist.txt" SESS_INFO = "sessionInfo.log" INDEX_FILE = "tagsIndex.json" diff --git a/nw/project/project.py b/nw/project/project.py index a8960de2..60cdfa72 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -50,7 +50,6 @@ class NWProject(): self.trashRoot = None # The handle of the trash root folder self.projPath = None # The full path to where the currently open project is saved self.projMeta = None # The full path to the project's meta data folder - self.projCache = None # The full path to the project's cache folder self.projDict = None # The spell check dictionary self.projFile = None # The file name of the project main xml file @@ -154,7 +153,6 @@ class NWProject(): self.trashRoot = None self.projPath = None self.projMeta = None - self.projCache = None self.projDict = None self.projFile = nwFiles.PROJ_FILE self.projName = "" @@ -196,14 +194,11 @@ class NWProject(): self.projPath = path.dirname(fileName) logger.debug("Opening project: %s" % self.projPath) - self.projMeta = path.join(self.projPath,"meta") - self.projCache = path.join(self.projPath,"cache") - self.projDict = path.join(self.projMeta, nwFiles.PROJ_DICT) + self.projMeta = path.join(self.projPath,"meta") + self.projDict = path.join(self.projMeta, nwFiles.PROJ_DICT) if not self._checkFolder(self.projMeta): return - if not self._checkFolder(self.projCache): - return try: nwXML = etree.parse(fileName) @@ -299,12 +294,10 @@ class NWProject(): self.makeAlert("Project path not set, cannot save.", nwAlert.ERROR) return False - self.projMeta = path.join(self.projPath,"meta") - self.projCache = path.join(self.projPath,"cache") + self.projMeta = path.join(self.projPath,"meta") - if not self._checkFolder(self.projPath): return - if not self._checkFolder(self.projMeta): return - if not self._checkFolder(self.projCache): return + if not self._checkFolder(self.projPath): return + if not self._checkFolder(self.projMeta): return logger.debug("Saving project: %s" % self.projPath) diff --git a/tests/test_gui.py b/tests/test_gui.py index 89121ace..dc279222 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -37,7 +37,6 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): assert nwGUI.theProject.trashRoot is None assert nwGUI.theProject.projPath is None assert nwGUI.theProject.projMeta is None - assert nwGUI.theProject.projCache is None assert nwGUI.theProject.projFile == "nwProject.nwx" assert nwGUI.theProject.projName == "" assert nwGUI.theProject.bookTitle == "" @@ -62,7 +61,6 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): assert nwGUI.theProject.trashRoot is None assert nwGUI.theProject.projPath == nwTempGUI assert nwGUI.theProject.projMeta == path.join(nwTempGUI,"meta") - assert nwGUI.theProject.projCache == path.join(nwTempGUI,"cache") assert nwGUI.theProject.projFile == "nwProject.nwx" assert nwGUI.theProject.projName == "" assert nwGUI.theProject.bookTitle == ""