From 3e0bcfdb1c0bbc9bea7c2643a715975b8aede98f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 9 May 2020 18:37:38 +0200 Subject: [PATCH 1/5] Added appPath and homePath to debug output --- nw/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nw/config.py b/nw/config.py index f0f21f32..4fb8278e 100644 --- a/nw/config.py +++ b/nw/config.py @@ -227,6 +227,9 @@ class Config: self.iconPath = path.join(self.assetPath,"icons") self.appIcon = path.join(self.iconPath, nwFiles.APP_ICON) + logger.verbose("App path: %s" % self.appPath) + logger.verbose("Home path: %s" % self.homePath) + # If config folder does not exist, make it. # This assumes that the os config folder itself exists. if not path.isdir(self.confPath): From df782e823d93c3b1b915eabcd9ecc30953ffd8ce Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 10 May 2020 23:55:56 +0200 Subject: [PATCH 2/5] Reduced the number of command line switches --- nw/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 8c5199d9..9426d840 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -92,7 +92,7 @@ def main(sysArgs=None): sysArgs = sys.argv[1:] # Valid Input Options - shortOpt = "hidvql:" + shortOpt = "hvq" longOpt = [ "help", "version", @@ -118,12 +118,12 @@ def main(sysArgs=None): "\n" "Usage:\n" " -h, --help Print this message.\n" - " --version Print program version and exit.\n" - " -i, --info Print additional runtime information.\n" - " -d, --debug Print debug output. Includes -i.\n" - " -v, --verbose Increase verbosity of debug output. Includes -d.\n" + " -v, --version Print program version and exit.\n" + " --info Print additional runtime information.\n" + " --debug Print debug output. Includes -i.\n" + " --verbose Increase verbosity of debug output. Includes -d.\n" " -q, --quiet Disable output to command line. Does not affect log file.\n" - " -l, --logfile= Specify log file.\n" + " --logfile= Specify log file.\n" " --style= Sets Qt5 style flag. Defaults to 'Fusion'.\n" " --config= Alternative config file.\n" " --data= Alternative user data path.\n" @@ -162,20 +162,20 @@ def main(sysArgs=None): if inOpt in ("-h","--help"): print(helpMsg) sys.exit() - elif inOpt == "--version": + elif inOptin ("-v", "--version"): print("%s %s Version %s" % (__package__,__status__,__version__)) sys.exit() - elif inOpt in ("-i", "--info"): + elif inOpt == "--info": debugLevel = logging.INFO - elif inOpt in ("-d", "--debug"): + elif inOpt == "--debug": debugLevel = logging.DEBUG logFormat = "[{asctime:}] {name:>30}:{lineno:<4d} {levelname:8} {message:}" - elif inOpt in ("-l","--logfile"): + elif inOpt == "--logfile": logFile = inArg toFile = True elif inOpt in ("-q","--quiet"): toStd = False - elif inOpt in ("-v","--verbose"): + elif inOpt == "--verbose": debugLevel = VERBOSE logFormat = "[{asctime:}] {name:>30}:{lineno:<4d} {levelname:8} {message:}" elif inOpt == "--style": From c3f1581acf80483b9d7e5829e3024d3d06255c8e Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 10 May 2020 23:56:41 +0200 Subject: [PATCH 3/5] oopsie --- nw/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nw/__init__.py b/nw/__init__.py index 9426d840..89b5e04d 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -162,7 +162,7 @@ def main(sysArgs=None): if inOpt in ("-h","--help"): print(helpMsg) sys.exit() - elif inOptin ("-v", "--version"): + elif inOpt in ("-v", "--version"): print("%s %s Version %s" % (__package__,__status__,__version__)) sys.exit() elif inOpt == "--info": From 41808ea9b84f2e007d1849d947519d1cd806751f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 10 May 2020 23:58:44 +0200 Subject: [PATCH 4/5] Changed __status__ to Pre-Release --- nw/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nw/__init__.py b/nw/__init__.py index 89b5e04d..365d2b3b 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -44,7 +44,7 @@ __version__ = "0.5" __date__ = "2020-05-09" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" -__status__ = "Development" +__status__ = "Pre-Release" __url__ = "https://github.com/vkbo/novelWriter" __docurl__ = "https://novelwriter.readthedocs.io" __credits__ = [ From aab0b4a8460fcce467c2b095136c6d166482d337 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 11 May 2020 00:03:28 +0200 Subject: [PATCH 5/5] Fixed help text and added date to the version and help output --- nw/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 365d2b3b..85b5cab4 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -108,7 +108,7 @@ def main(sysArgs=None): ] helpMsg = ( - "{appname} {version} ({status})\n" + "{appname} {version} ({status} {date})\n" "{copyright}\n" "\n" "This program is distributed in the hope that it will be useful,\n" @@ -120,8 +120,8 @@ def main(sysArgs=None): " -h, --help Print this message.\n" " -v, --version Print program version and exit.\n" " --info Print additional runtime information.\n" - " --debug Print debug output. Includes -i.\n" - " --verbose Increase verbosity of debug output. Includes -d.\n" + " --debug Print debug output. Includes --info.\n" + " --verbose Increase verbosity of debug output. Includes --debug.\n" " -q, --quiet Disable output to command line. Does not affect log file.\n" " --logfile= Specify log file.\n" " --style= Sets Qt5 style flag. Defaults to 'Fusion'.\n" @@ -132,7 +132,8 @@ def main(sysArgs=None): appname = __package__, version = __version__, status = __status__, - copyright = __copyright__ + copyright = __copyright__, + date = __date__, ) # Defaults @@ -163,7 +164,7 @@ def main(sysArgs=None): print(helpMsg) sys.exit() elif inOpt in ("-v", "--version"): - print("%s %s Version %s" % (__package__,__status__,__version__)) + print("%s %s Version %s [%s]" % (__package__,__status__,__version__,__date__)) sys.exit() elif inOpt == "--info": debugLevel = logging.INFO