From a90177afa0bd1846cf7cbb92b93b770aff065082 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 28 Dec 2021 20:17:51 +0100 Subject: [PATCH] Better version output in about page (exe file, pyPi, git commit string removed if empty) --- cps/about.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cps/about.py b/cps/about.py index ba5a99af..7e839520 100644 --- a/cps/about.py +++ b/cps/about.py @@ -74,13 +74,22 @@ opt = dep_check.load_dependencys(True) for i in (req + opt): ret[i[1]] = i[0] +if constants.NIGHTLY_VERSION[0] == "$Format:%H$": + calibre_web_version = constants.STABLE_VERSION['version'] +else: + calibre_web_version = (constants.STABLE_VERSION['version'] + ' - ' + + constants.NIGHTLY_VERSION[0].replace('%','%%') + ' - ' + + constants.NIGHTLY_VERSION[1].replace('%','%%')) +if getattr(sys, 'frozen', False): + calibre_web_version += " - Exe-Version" +elif constants.HOME_CONFIG: + calibre_web_version += " - pyPi" + if not ret: _VERSIONS = OrderedDict( Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()), Python=sys.version, - Calibre_Web=constants.STABLE_VERSION['version'] + ' - ' - + constants.NIGHTLY_VERSION[0].replace('%','%%') + ' - ' - + constants.NIGHTLY_VERSION[1].replace('%','%%'), + Calibre_Web=calibre_web_version, WebServer=server.VERSION, Flask=flask.__version__, Flask_Login=flask_loginVersion, @@ -110,9 +119,7 @@ else: _VERSIONS = OrderedDict( Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()), Python = sys.version, - Calibre_Web = constants.STABLE_VERSION['version'] + ' - ' - + constants.NIGHTLY_VERSION[0].replace('%', '%%') + ' - ' - + constants.NIGHTLY_VERSION[1].replace('%', '%%'), + Calibre_Web=calibre_web_version, Werkzeug = werkzeug.__version__, Jinja2=jinja2.__version__, pySqlite = sqlite3.version,