diff --git a/cuegui/cuegui/Constants.py b/cuegui/cuegui/Constants.py index 6c3d8dcb8..1c51a509d 100644 --- a/cuegui/cuegui/Constants.py +++ b/cuegui/cuegui/Constants.py @@ -102,7 +102,7 @@ def __get_version_from_cmd(command): print(f"Command failed with return code {e.returncode}: {e}") except Exception as e: print(f"Failed to get version from command: {e}") - return None + return __config.get('version', __packaged_version()) __config = __loadConfigFromFile() diff --git a/cuegui/cuegui/MainWindow.py b/cuegui/cuegui/MainWindow.py index d9db14424..a27990cfd 100644 --- a/cuegui/cuegui/MainWindow.py +++ b/cuegui/cuegui/MainWindow.py @@ -119,16 +119,19 @@ def showStatusBarMessage(self, message, delay=5000): def displayAbout(self): """Displays about text.""" - msg = self.app_name + "\n\nA opencue tool\n\n" - msg += "CueGUI:\n%s\n\n" % cuegui.Constants.VERSION - - if os.getenv('OPENCUE_BETA'): - msg += "(Beta Version)\n\n" - else: - msg += "(Stable Version)\n\n" + msg = f"{self.app_name}\n\nA opencue tool\n\n" + msg += f"CueGUI:\n{cuegui.Constants.VERSION}\n\n" + + # Only show the labels (Beta or Stable) if OPENCUE_BETA exists + opencue_beta = os.getenv('OPENCUE_BETA') + if opencue_beta: + if opencue_beta == '1': + msg += "(Beta Version)\n\n" + else: + msg += "(Stable Version)\n\n" - msg += "Qt:\n%s\n\n" % QtCore.qVersion() - msg += "Python:\n%s\n\n" % sys.version + msg += f"Qt:\n{QtCore.qVersion()}\n\n" + msg += f"Python:\n{sys.version}\n\n" QtWidgets.QMessageBox.about(self, "About", msg) def handleExit(self, sig, flag):