From 7af167ba11311f5c92006f6ccb8c14b296bfcff1 Mon Sep 17 00:00:00 2001 From: Diego Tavares Date: Thu, 22 Aug 2024 14:19:33 -0700 Subject: [PATCH 1/2] Fix logviewer issue on invalid type Current logic would fail with `str has no attribute append` when a log editor is configured using cuegui.yaml --- cuegui/cuegui/Utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)) From bee8cbc718ad770667213be6aaaecb428a631936 Mon Sep 17 00:00:00 2001 From: Diego Tavares Date: Thu, 22 Aug 2024 14:30:52 -0700 Subject: [PATCH 2/2] Handle None jobs on FrameMonitorTree.setJob `__setJob` can be called with job=None and that wasn't handled properly --- cuegui/cuegui/FrameMonitorTree.py | 5 +++-- 1 file changed, 3 insertions(+), 2 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()