From 68941da3c8c08c5995c933d8b21317de6ddb73cc Mon Sep 17 00:00:00 2001 From: Vic Bartel Date: Fri, 25 Mar 2022 10:33:23 +0100 Subject: [PATCH] Add fixes for hound --- .../plugins/publish/collect_shotgrid_entities.py | 10 ++++------ .../plugins/publish/collect_shotgrid_session.py | 14 +++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_entities.py b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_entities.py index b89dda3a80..6778b26550 100644 --- a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_entities.py +++ b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_entities.py @@ -1,7 +1,9 @@ import os + import pyblish.api from pymongo import MongoClient -from openpype.api import get_project_settings + +from openpype.modules.shotgrid.lib.settings import get_shotgrid_project_settings class CollectShotgridEntities(pyblish.api.ContextPlugin): @@ -64,12 +66,8 @@ def _get_shotgrid_collection(project): return client.get_database("shotgrid_openpype").get_collection(project) -def _get_shotgrid_project_settings(project): - return get_project_settings(project).get("shotgrid", {}) - - def _get_shotgrid_project(avalon_project): - proj_settings = _get_shotgrid_project_settings(avalon_project["name"]) + proj_settings = get_shotgrid_project_settings(avalon_project["name"]) shotgrid_project_id = proj_settings.get("shotgrid_project_id") if shotgrid_project_id: return {"type": "Project", "id": shotgrid_project_id} diff --git a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py index 60071ad2fc..9d5d2271bf 100644 --- a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py +++ b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py @@ -1,10 +1,14 @@ import os + import pyblish.api import shotgun_api3 from shotgun_api3.shotgun import AuthenticationFault + from openpype.lib import OpenPypeSettingsRegistry -from openpype.api import get_project_settings, get_system_settings -from openpype.modules.shotgrid.lib.settings import get_shotgrid_servers +from openpype.modules.shotgrid.lib.settings import ( + get_shotgrid_servers, + get_shotgrid_project_settings, +) class CollectShotgridSession(pyblish.api.ContextPlugin): @@ -40,7 +44,7 @@ class CollectShotgridSession(pyblish.api.ContextPlugin): avalon_project = os.getenv("AVALON_PROJECT") - shotgrid_settings = get_shotgrid_settings(avalon_project) + shotgrid_settings = get_shotgrid_project_settings(avalon_project) self.log.info("shotgrid settings: {}".format(shotgrid_settings)) shotgrid_servers_settings = get_shotgrid_servers() self.log.info( @@ -111,10 +115,6 @@ def set_shotgrid_certificate(certificate): os.environ["SHOTGUN_API_CACERTS"] = certificate -def get_shotgrid_settings(project): - return get_project_settings(project).get("shotgrid", {}) - - def get_login(): reg = OpenPypeSettingsRegistry() try: