From f2b35d798b23eebbecca32193d9cf7cf910a21dc Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:53:52 +0100 Subject: [PATCH] Make some minor corrections --- novelwriter/core/project.py | 3 +-- novelwriter/core/storage.py | 4 ++-- novelwriter/guimain.py | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/novelwriter/core/project.py b/novelwriter/core/project.py index e2168799..d23be235 100644 --- a/novelwriter/core/project.py +++ b/novelwriter/core/project.py @@ -306,8 +306,7 @@ class NWProject: self._loadProjectLocalisation() # Update recent projects - storePath = self._storage.storagePath - if storePath: + if storePath := self._storage.storagePath: CONFIG.recentProjects.update( storePath, self._data.name, sum(self._data.initCounts), time() ) diff --git a/novelwriter/core/storage.py b/novelwriter/core/storage.py index 5b0a61a6..21327ac1 100644 --- a/novelwriter/core/storage.py +++ b/novelwriter/core/storage.py @@ -163,13 +163,13 @@ class NWStorage: return True def initProjectStorage(self, path: str | Path, clearLock: bool = False) -> NWStorageOpen: - """Initialise the a novelWriter project.""" + """Initialise a novelWriter project location.""" inPath = Path(path).resolve() # Initialise Storage Instance # =========================== - # Check what we're opening. Only three options are allowed: + # Check what we're opening. Only two options are allowed: # 1. A folder with a nwProject.nwx file in it (not home) # 2. A full path to an nwProject.nwx file if inPath.is_dir() and inPath != Path.home().resolve(): diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 17f91f4f..ec8680fd 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -462,8 +462,7 @@ class GuiMain(QMainWindow): if projFile is None: return False - # Make sure any open project is cleared out first before we load - # another one + # Make sure any open project is cleared out first if not self.closeProject(): return False