diff --git a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py index 65a5de9f22..b9eead6244 100644 --- a/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py +++ b/openpype/modules/shotgrid/plugins/publish/collect_shotgrid_session.py @@ -1,5 +1,4 @@ import os -import sys import pyblish.api import shotgun_api3 from shotgun_api3.shotgun import AuthenticationFault @@ -128,5 +127,5 @@ def get_login(): reg = OpenPypeSettingsRegistry() try: return str(reg.get_item("shotgrid_login")) - except Exception as e: + except Exception as _: return None diff --git a/openpype/modules/shotgrid/plugins/publish/validate_shotgrid_user.py b/openpype/modules/shotgrid/plugins/publish/validate_shotgrid_user.py index 7343c47808..c14c980e2a 100644 --- a/openpype/modules/shotgrid/plugins/publish/validate_shotgrid_user.py +++ b/openpype/modules/shotgrid/plugins/publish/validate_shotgrid_user.py @@ -4,16 +4,16 @@ import openpype.api class ValidateShotgridUser(pyblish.api.ContextPlugin): """ - Check if user is valid and have access to the project. + Check if user is valid and have access to the project. """ label = "Validate Shotgrid User" order = openpype.api.ValidateContentsOrder def process(self, context): - sg = context.data.get('shotgridSession') + sg = context.data.get("shotgridSession") - login = context.data.get('shotgridUser') + login = context.data.get("shotgridUser") self.log.info("Login shotgrid set in OpenPype is {}".format(login)) project = context.data.get("shotgridProject") self.log.info("Current shotgun project is {}".format(project)) @@ -21,16 +21,18 @@ class ValidateShotgridUser(pyblish.api.ContextPlugin): if not (login and sg and project): raise KeyError() - user = sg.find_one( - "HumanUser", - [["login", "is", login]], - ["projects"] - ) + user = sg.find_one("HumanUser", [["login", "is", login]], ["projects"]) self.log.info(user) self.log.info(login) user_projects_id = [p["id"] for p in user.get("projects", [])] - if not project.get('id') in user_projects_id: - raise PermissionError("Login {} don't have access to the project {}".format(login, project)) + if not project.get("id") in user_projects_id: + raise PermissionError( + "Login {} don't have access to the project {}".format( + login, project + ) + ) - self.log.info("Login {} have access to the project {}".format(login, project)) + self.log.info( + "Login {} have access to the project {}".format(login, project) + ) diff --git a/openpype/modules/shotgrid/shotgrid_module.py b/openpype/modules/shotgrid/shotgrid_module.py index 75d5f843c5..222c4c2e1f 100644 --- a/openpype/modules/shotgrid/shotgrid_module.py +++ b/openpype/modules/shotgrid/shotgrid_module.py @@ -43,7 +43,9 @@ class ShotgridModule( def get_plugin_paths(self) -> Dict[str, Any]: return { - "publish": [os.path.join(SHOTGRID_MODULE_DIR, "plugins", "publish")] + "publish": [ + os.path.join(SHOTGRID_MODULE_DIR, "plugins", "publish") + ] } def get_launch_hook_paths(self) -> str: diff --git a/openpype/settings/entities/enum_entity.py b/openpype/settings/entities/enum_entity.py index 643bd5735d..3b3dd47e61 100644 --- a/openpype/settings/entities/enum_entity.py +++ b/openpype/settings/entities/enum_entity.py @@ -23,7 +23,9 @@ class BaseEnumEntity(InputEntity): for item in self.enum_items: key = tuple(item.keys())[0] if key in enum_keys: - reason = 'Key "{}" is more than once in enum items.'.format(key) + reason = 'Key "{}" is more than once in enum items.'.format( + key + ) raise EntitySchemaError(self, reason) enum_keys.add(key)