From aaa4c1d54ce71771bdc9a8608c42a5e5213b6b47 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 24 Mar 2022 11:53:57 +0100 Subject: [PATCH 1/4] Add generic exception handling for Slack notification --- openpype/modules/slack/plugins/publish/integrate_slack_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/modules/slack/plugins/publish/integrate_slack_api.py b/openpype/modules/slack/plugins/publish/integrate_slack_api.py index 018a7594bb..c0392b0195 100644 --- a/openpype/modules/slack/plugins/publish/integrate_slack_api.py +++ b/openpype/modules/slack/plugins/publish/integrate_slack_api.py @@ -210,6 +210,9 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin): # You will get a SlackApiError if "ok" is False error_str = self._enrich_error(str(e.response["error"]), channel) self.log.warning("Error happened {}".format(error_str)) + except Exception as e: + error_str = self._enrich_error(str(e), channel) + self.log.warning("Not SlackAPI error: {}".format(error_str)) return None, [] From 4442ef71289fb6b9fdd9694ed5516dedfb73732d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 24 Mar 2022 11:57:56 +0100 Subject: [PATCH 2/4] Update openpype/modules/slack/plugins/publish/integrate_slack_api.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/modules/slack/plugins/publish/integrate_slack_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/modules/slack/plugins/publish/integrate_slack_api.py b/openpype/modules/slack/plugins/publish/integrate_slack_api.py index c0392b0195..f236662361 100644 --- a/openpype/modules/slack/plugins/publish/integrate_slack_api.py +++ b/openpype/modules/slack/plugins/publish/integrate_slack_api.py @@ -212,7 +212,7 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin): self.log.warning("Error happened {}".format(error_str)) except Exception as e: error_str = self._enrich_error(str(e), channel) - self.log.warning("Not SlackAPI error: {}".format(error_str)) + self.log.warning("Not SlackAPI error", exc_info=True) return None, [] From 5402a99634f932e9a423d073fbc6cb53baf30283 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 13:31:38 +0100 Subject: [PATCH 3/4] fix imports in scene inventory --- openpype/tools/sceneinventory/switch_dialog.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openpype/tools/sceneinventory/switch_dialog.py b/openpype/tools/sceneinventory/switch_dialog.py index 252f5cde4c..bb3e2615ac 100644 --- a/openpype/tools/sceneinventory/switch_dialog.py +++ b/openpype/tools/sceneinventory/switch_dialog.py @@ -4,11 +4,12 @@ from Qt import QtWidgets, QtCore import qtawesome from bson.objectid import ObjectId -from avalon import io, pipeline -from openpype.pipeline import ( +from avalon import io +from openpype.pipeline.load import ( discover_loader_plugins, switch_container, get_repres_contexts, + loaders_from_repre_context, ) from .widgets import ( @@ -370,7 +371,7 @@ class SwitchAssetDialog(QtWidgets.QDialog): loaders = None for repre_context in repre_contexts.values(): - _loaders = set(pipeline.loaders_from_repre_context( + _loaders = set(loaders_from_repre_context( available_loaders, repre_context )) if loaders is None: From cf40d52d4d4c1e201e928d0d77730fe18d7f8e3f Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 13:31:45 +0100 Subject: [PATCH 4/4] removed debug prints --- openpype/pipeline/actions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/pipeline/actions.py b/openpype/pipeline/actions.py index a045c92aa7..141e277db3 100644 --- a/openpype/pipeline/actions.py +++ b/openpype/pipeline/actions.py @@ -115,10 +115,8 @@ def discover_inventory_actions(): filtered_actions = [] for action in actions: if action is not InventoryAction: - print("DISCOVERED", action) filtered_actions.append(action) - else: - print("GOT SOURCE") + return filtered_actions