From be8e476315c6ebd3c2c4eaa16fd51766a0d74d22 Mon Sep 17 00:00:00 2001 From: Himanshu Gohel <1551217+hgohel@users.noreply.github.com> Date: Thu, 21 Dec 2023 16:48:49 -0500 Subject: [PATCH] Report simpler Python version string in About and Error dialogs A gramps user reported on the discourse forum that information in the about box was truncated, and he could not expand the box to view the rest of the text. A look at the text in question suggested a simple change: the truncated string is intended to be the Python version which is typically major.minor.patch version, but the text being displayed is the output of sys.version() which includes additional information including build number and compiler used. For the About box this isn't necessarily useful, so this PR replaces that call with platform.python_version() which returns just the version and resolves the truncated string issue. The same change is also made in the error report dialog for consistency. An unrelated change is also included in this PR: after building the AIO bundle locally several artifacts are generated (or downloaded) to the source folder, which have been added to .gitignore to avoid tracking with git. --- .gitignore | 6 ++++++ gramps/gui/aboutdialog.py | 2 +- gramps/gui/logger/_errorreportassistant.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 64fb107ad76..2e503f54a64 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,12 @@ dist/ # Gramps docs/_build/ +# Gramps AIO build artifacts +aio/grampsaio64.nsi +aio/mingw-w64-x86_64-db-*.pkg.tar.xz +aio/mingw64 +gramps.egg-info + # Editing tags *.swp diff --git a/gramps/gui/aboutdialog.py b/gramps/gui/aboutdialog.py index 48f5de23877..74ffd1eb69d 100644 --- a/gramps/gui/aboutdialog.py +++ b/gramps/gui/aboutdialog.py @@ -179,7 +179,7 @@ def get_versions(self): + distro ) % ( ellipses(str(VERSION)), - ellipses(str(sys.version).replace("\n", "")), + ellipses(platform.python_version()), BSDDB_STR, ellipses(get_env_var("LANG", "")), ellipses(platform.system()), diff --git a/gramps/gui/logger/_errorreportassistant.py b/gramps/gui/logger/_errorreportassistant.py index 326275cfb49..a05a955e51b 100644 --- a/gramps/gui/logger/_errorreportassistant.py +++ b/gramps/gui/logger/_errorreportassistant.py @@ -213,7 +213,7 @@ def _get_sys_information(self): "cairo version : %s" % ( str(VERSION), - str(sys.version).replace("\n", ""), + platform.python_version(), BSDDB_STR, sqlite, get_env_var("LANG", ""),