From 87394e6fe5b7d0ae0f52222ca922659e5632dcbc Mon Sep 17 00:00:00 2001 From: Diego Tavares Date: Wed, 28 Aug 2024 11:11:12 -0700 Subject: [PATCH] Fix logviewer issue on invalid type (#1494) Current logic would fail with `str has no attribute append` when a log editor is configured using cuegui.yaml --- cuegui/cuegui/FrameMonitorTree.py | 5 +++-- cuegui/cuegui/Utils.py | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cuegui/cuegui/FrameMonitorTree.py b/cuegui/cuegui/FrameMonitorTree.py index c5a8dff5e..9f6baf2f8 100644 --- a/cuegui/cuegui/FrameMonitorTree.py +++ b/cuegui/cuegui/FrameMonitorTree.py @@ -387,9 +387,10 @@ def __setJob(self, job): @type job: job, string, None""" self.frameSearch = opencue.search.FrameSearch() self.__job = job - self.__jobState = job.state() self.removeAllItems() - self.__sortByColumnLoad() + if job: + self.__jobState = job.state() + self.__sortByColumnLoad() self._lastUpdate = 0 self.job_changed.emit() diff --git a/cuegui/cuegui/Utils.py b/cuegui/cuegui/Utils.py index bcf86ab78..916bba0ba 100644 --- a/cuegui/cuegui/Utils.py +++ b/cuegui/cuegui/Utils.py @@ -487,8 +487,11 @@ def popupView(file, facility=None): app = cuegui.app() if editor_from_env: job_log_cmd = editor_from_env.split() - elif app.settings.contains('LogEditor'): - job_log_cmd = app.settings.value("LogEditor") + elif app.settings.contains('LogEditor') and ( + len(app.settings.value("LogEditor").strip()) > 0): + job_log_cmd = app.settings.value("LogEditor").split() + if not isinstance(job_log_cmd, list): + job_log_cmd = job_log_cmd.split() else: job_log_cmd = cuegui.Constants.DEFAULT_EDITOR.split() job_log_cmd.append(str(file))