Better version output in about page (exe file, pyPi, git commit string removed if empty)

This commit is contained in:
Ozzieisaacs 2021-12-28 20:17:51 +01:00
parent c095ee3c14
commit a90177afa0

View File

@ -74,13 +74,22 @@ opt = dep_check.load_dependencys(True)
for i in (req + opt): for i in (req + opt):
ret[i[1]] = i[0] 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: if not ret:
_VERSIONS = OrderedDict( _VERSIONS = OrderedDict(
Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()), Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()),
Python=sys.version, Python=sys.version,
Calibre_Web=constants.STABLE_VERSION['version'] + ' - ' Calibre_Web=calibre_web_version,
+ constants.NIGHTLY_VERSION[0].replace('%','%%') + ' - '
+ constants.NIGHTLY_VERSION[1].replace('%','%%'),
WebServer=server.VERSION, WebServer=server.VERSION,
Flask=flask.__version__, Flask=flask.__version__,
Flask_Login=flask_loginVersion, Flask_Login=flask_loginVersion,
@ -110,9 +119,7 @@ else:
_VERSIONS = OrderedDict( _VERSIONS = OrderedDict(
Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()), Platform = '{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()),
Python = sys.version, Python = sys.version,
Calibre_Web = constants.STABLE_VERSION['version'] + ' - ' Calibre_Web=calibre_web_version,
+ constants.NIGHTLY_VERSION[0].replace('%', '%%') + ' - '
+ constants.NIGHTLY_VERSION[1].replace('%', '%%'),
Werkzeug = werkzeug.__version__, Werkzeug = werkzeug.__version__,
Jinja2=jinja2.__version__, Jinja2=jinja2.__version__,
pySqlite = sqlite3.version, pySqlite = sqlite3.version,