From 110d27d06781641c9c924a94f74638c871b73847 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 17 Feb 2020 13:30:26 +0100 Subject: [PATCH 1/4] Cleanup of imports --- nw/config.py | 2 +- nw/gui/dialogs/itemeditor.py | 2 -- nw/gui/dialogs/projecteditor.py | 2 -- nw/gui/dialogs/timelineview.py | 2 -- nw/gui/elements/doceditor.py | 4 ++-- nw/gui/elements/viewdetails.py | 2 -- nw/project/item.py | 3 --- nw/project/project.py | 1 - 8 files changed, 3 insertions(+), 15 deletions(-) diff --git a/nw/config.py b/nw/config.py index a932553e..eb0720a4 100644 --- a/nw/config.py +++ b/nw/config.py @@ -15,7 +15,7 @@ import configparser import sys import nw -from os import path, mkdir, makedirs +from os import path, mkdir from datetime import datetime from PyQt5.Qt import PYQT_VERSION_STR diff --git a/nw/gui/dialogs/itemeditor.py b/nw/gui/dialogs/itemeditor.py index 0dc219ff..5383aefa 100644 --- a/nw/gui/dialogs/itemeditor.py +++ b/nw/gui/dialogs/itemeditor.py @@ -13,8 +13,6 @@ import logging import nw -from os import path - from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QHBoxLayout, QVBoxLayout, QGroupBox, QFormLayout, QLineEdit, diff --git a/nw/gui/dialogs/projecteditor.py b/nw/gui/dialogs/projecteditor.py index 6a09fe7d..3b8c0114 100644 --- a/nw/gui/dialogs/projecteditor.py +++ b/nw/gui/dialogs/projecteditor.py @@ -13,8 +13,6 @@ import logging import nw -from os import path - from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush from PyQt5.QtWidgets import ( diff --git a/nw/gui/dialogs/timelineview.py b/nw/gui/dialogs/timelineview.py index dab545fc..5046d112 100644 --- a/nw/gui/dialogs/timelineview.py +++ b/nw/gui/dialogs/timelineview.py @@ -13,8 +13,6 @@ import logging import nw -from os import path - from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor, QPixmap from PyQt5.QtWidgets import ( diff --git a/nw/gui/elements/doceditor.py b/nw/gui/elements/doceditor.py index 28a63dce..d277ac75 100644 --- a/nw/gui/elements/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -26,8 +26,8 @@ from PyQt5.QtGui import ( from nw.project import NWDoc from nw.gui.tools import GuiDocHighlighter, WordCounter -from nw.tools import NWSpellCheck, NWSpellSimple -from nw.constants import nwFiles, nwUnicode, nwDocAction, nwAlert +from nw.tools import NWSpellSimple +from nw.constants import nwUnicode, nwDocAction logger = logging.getLogger(__name__) diff --git a/nw/gui/elements/viewdetails.py b/nw/gui/elements/viewdetails.py index 2a0c9a29..929e8026 100644 --- a/nw/gui/elements/viewdetails.py +++ b/nw/gui/elements/viewdetails.py @@ -18,8 +18,6 @@ from PyQt5.QtWidgets import ( QWidget, QLabel, QScrollArea, QFrame, QToolButton, QCheckBox, QGridLayout ) -from nw.constants import nwLabels - logger = logging.getLogger(__name__) class GuiDocViewDetails(QWidget): diff --git a/nw/project/item.py b/nw/project/item.py index 5eb98f4b..7ed0e6a3 100644 --- a/nw/project/item.py +++ b/nw/project/item.py @@ -14,7 +14,6 @@ import logging import nw from lxml import etree -from datetime import datetime from nw.common import checkInt from nw.constants import nwItemType, nwItemClass, nwItemLayout @@ -23,8 +22,6 @@ logger = logging.getLogger(__name__) class NWItem(): - MAX_DEPTH = 8 - def __init__(self, theProject): self.theProject = theProject diff --git a/nw/project/project.py b/nw/project/project.py index 26e385f7..bc934b21 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -14,7 +14,6 @@ import logging import nw from os import path, mkdir, listdir, unlink, rename -from shutil import copyfile from lxml import etree from hashlib import sha256 from datetime import datetime From 7c1f6130145817cdbfca27e809504acba40c00bd Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 17 Feb 2020 13:43:05 +0100 Subject: [PATCH 2/4] Bumped version and removed -t command line argument --- nw/__init__.py | 17 ++++++----------- setup.py | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 02b62656..e5da6b5c 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -25,8 +25,8 @@ __package__ = "novelWriter" __author__ = "Veronica Berglyd Olsen" __copyright__ = "Copyright 2018–2019, Veronica Berglyd Olsen" __license__ = "GPLv3" -__version__ = "0.4.3" -__date__ = "2019-11-24" +__version__ = "0.4.4" +__date__ = "2020-02-17" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" __status__ = "Development" @@ -77,14 +77,13 @@ def main(sysArgs=None): sysArgs = sys.argv[1:] # Valid Input Options - shortOpt = "hdiqtl:v" + shortOpt = "hdiql:v" longOpt = [ "help", "debug", "info", "verbose", "quiet", - "time", "logfile=", "version", "config=", @@ -103,7 +102,6 @@ def main(sysArgs=None): " -d, --debug Print debug output.\n" " --verbose Increase verbosity of debug output.\n" " -q, --quiet Disable output to command line. Does not affect log file.\n" - " -t, --time Shows time stamp in logging output.\n" " -l, --logfile= Specify log file.\n" " --style= Set Qt5 style flag. Defaults to 'Fusion'.\n" " --config= Alternative config file.\n" @@ -118,11 +116,9 @@ def main(sysArgs=None): # Defaults debugLevel = logging.WARN debugStr = "{levelname:8} {message:}" - timeStr = "[{asctime:}] " logFile = "" toFile = False toStd = True - showTime = False confPath = None testMode = False qtStyle = "Fusion" @@ -149,7 +145,7 @@ def main(sysArgs=None): debugLevel = logging.INFO elif inOpt in ("-d", "--debug"): debugLevel = logging.DEBUG - debugStr = "{name:>30}:{lineno:<4d} {levelname:8} {message:}" + debugStr = "[{asctime:}] {name:>30}:{lineno:<4d} {levelname:8} {message:}" elif inOpt in ("-l","--logfile"): logFile = inArg toFile = True @@ -157,8 +153,6 @@ def main(sysArgs=None): toStd = False elif inOpt in ("--verbose"): debugLevel = VERBOSE - elif inOpt in ("-t","--time"): - showTime = True elif inOpt in ("--style"): qtStyle = inArg elif inOpt in ("--config"): @@ -172,7 +166,6 @@ def main(sysArgs=None): CONFIG.cmdOpen = cmdOpen # Set Logging - if showTime: debugStr = timeStr+debugStr logFmt = logging.Formatter(fmt=debugStr,datefmt="%Y-%m-%d %H:%M:%S",style="{") if not logFile == "" and toFile: @@ -201,6 +194,8 @@ def main(sysArgs=None): return nwGUI else: nwApp = QApplication([__package__,("-style=%s" % qtStyle)]) + nwApp.setApplicationName(__package__) + nwApp.setApplicationVersion(__version__) nwGUI = GuiMain() sys.exit(nwApp.exec_()) diff --git a/setup.py b/setup.py index 081befd5..7d2436dd 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r") as inFile: setuptools.setup( name = "novelWriter", - version = "0.4.3", + version = "0.4.4", author = "Veronica Berglyd Olsen", author_email = "code@vkbo.net", description = "A markdown-like document editor for writing novels", @@ -35,7 +35,7 @@ setuptools.setup( "Natural Language :: English", "Topic :: Text Editors", ], - python_requires = ">=3.5", + python_requires = ">=3.6", install_requires = [ "pyqt5", "lxml", From e325aa4bb045de02f847de7dac808ea3f46e4bd9 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 17 Feb 2020 13:48:23 +0100 Subject: [PATCH 3/4] A few more places to bump stuff --- docs/source/conf.py | 6 +++--- nw/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 62a72b99..35673d92 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,13 +20,13 @@ # -- Project information ----------------------------------------------------- project = "novelWriter" -copyright = "2018-2019, Veronica Berglyd Olsen" +copyright = "2018-2020, Veronica Berglyd Olsen" author = "Veronica Berglyd Olsen" # The short X.Y version -version = "0.4.3" +version = "0.4.4" # The full version, including alpha/beta/rc tags -release = "0.4.3" +release = "0.4.4" # -- General configuration --------------------------------------------------- diff --git a/nw/__init__.py b/nw/__init__.py index e5da6b5c..87f77974 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -23,7 +23,7 @@ from nw.config import Config __package__ = "novelWriter" __author__ = "Veronica Berglyd Olsen" -__copyright__ = "Copyright 2018–2019, Veronica Berglyd Olsen" +__copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen" __license__ = "GPLv3" __version__ = "0.4.4" __date__ = "2020-02-17" From 2094d67c38090f2096876cc5959f6136c784dcd9 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 17 Feb 2020 14:08:45 +0100 Subject: [PATCH 4/4] Updated changelog --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e21175..601bd6b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # novelWriter ChangeLog +## Version 0.4.4 [2020-02-17] + +**Features** + +* A project can now be opened from the command line by providing the project path to the launching script. PRs #164 and #166. + +**User Interface** + +* Added functionality to split a document into a folder of multiple documents, and also to merge a folder of documents into a single document. PRs #159 and #163. +* It is now possible to permanently delete files from the Trash folder. This can be done file-by-file or by using the Empty Trash option in the menu. PRs #159 and #163. +* When running the spell checker, a wait cursor is displayed. This will alert the user that novelWriter is working on something when, for instance, a very large document is opened and initial spell checking is running. PR #158. + +**Bug Fixes** + +* Fixed a few keyboard shortcuts that were not working in distraction free mode. PR #157. +* Added a check to ensure the user does not drag and drop an item into the Orphaned Items folder. Since this folder is not an actual project item, novelWriter would crash when trying to change the dropped item's parent item to the Orphaned Items folder. Now, instead, the drop event is cancelled if the target folder is Orphaned Items. PR #163. + +**Code Improvements** + +* The way project files are saved has been altered slightly. When a project file or document file is saved, the data is first streamed to a temp file. Then the old storage file is renamed to .bak, and and the temp file is renamed to the correct storage file name. This ensures that the storage file is only replaced after a complete and successful write. PR #165. +* The cache folder has been removed. It was used to store the 10 most recent versions of the project file. Instead, the previous project file is renamed to .bak, and can be restored if opening from the latest project file fails. Any additional restore capabilities should be ensured by backup solutions, either the internal simple zip backup, or other third party tools. PR #165. +* The dependency on the Python package `appdirs` has been dropped. It was used only for extracting the path to the user's config folder, a feature which is also provided by Qt. PR #169. + ## Version 0.4.3 [2019-11-24] **User Interface**