diff --git a/.gitignore b/.gitignore index fe41ae4e2..ad90cc081 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ aqt/forms locale tools/runanki.system +aqt/buildhash.py diff --git a/aqt/about.py b/aqt/about.py index 0427d22d9..3469f9a81 100644 --- a/aqt/about.py +++ b/aqt/about.py @@ -4,7 +4,7 @@ from aqt.qt import * import aqt.forms -from aqt import appVersion +from aqt.utils import versionWithBuild class ClosableQDialog(QDialog): def reject(self): @@ -29,7 +29,7 @@ def show(mw): system. It's free and open source.") abouttext += "

"+_("Anki is licensed under the AGPL3 license. Please see " "the license file in the source distribution for more information.") - abouttext += '

' + _("Version %s") % appVersion + '
' + abouttext += '

' + _("Version %s") % versionWithBuild() + '
' abouttext += ("Qt %s PyQt %s
") % (QT_VERSION_STR, PYQT_VERSION_STR) abouttext += (_("Visit website") % aqt.appWebsite) + \ "" diff --git a/aqt/errors.py b/aqt/errors.py index b0d057a9a..7eeebb104 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -134,7 +134,7 @@ add-ons section of our support site. def _supportText(self): import platform - from aqt import appVersion + from aqt.utils import versionWithBuild if isWin: platname = "Windows " + platform.win32_ver()[0] @@ -153,5 +153,5 @@ add-ons section of our support site. Anki {} Python {} Qt {} PyQt {} Platform: {} Flags: frz={} ao={} sv={} -""".format(appVersion, platform.python_version(), QT_VERSION_STR, PYQT_VERSION_STR, platname, +""".format(versionWithBuild(), platform.python_version(), QT_VERSION_STR, PYQT_VERSION_STR, platname, getattr(sys, "frozen", False), self.mw.addonManager.dirty, schedVer()) diff --git a/aqt/utils.py b/aqt/utils.py index 0e62ad4c2..456057a8b 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -523,3 +523,12 @@ class MenuItem: a = qmenu.addAction(self.title) a.triggered.connect(self.func) +###################################################################### + +def versionWithBuild(): + from aqt import appVersion + try: + from aqt.buildhash import build + except: + build = "dev" + return "%s (%s)" % (appVersion, build)