Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cuegui] Fix CueGUI version handling and improve error handling #1538

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cuegui/cuegui/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
21 changes: 12 additions & 9 deletions cuegui/cuegui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading