From cf82186326af5b4eb7f9b0487658bc9774a7c1a1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Dec 2020 09:53:03 +0100 Subject: [PATCH] remove hooks that were added during merge --- pype/hooks/fusion/prelaunch.py | 61 ----------------------------- pype/hooks/resolve/prelaunch.py | 69 --------------------------------- 2 files changed, 130 deletions(-) delete mode 100644 pype/hooks/fusion/prelaunch.py delete mode 100644 pype/hooks/resolve/prelaunch.py diff --git a/pype/hooks/fusion/prelaunch.py b/pype/hooks/fusion/prelaunch.py deleted file mode 100644 index 5c9535c11f..0000000000 --- a/pype/hooks/fusion/prelaunch.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import traceback -import importlib -from pype.lib import PypeHook -from pype.api import Logger -from pype.hosts.fusion import utils - - -class FusionPrelaunch(PypeHook): - """ - This hook will check if current workfile path has Fusion - project inside. - """ - - def __init__(self, logger=None): - if not logger: - self.log = Logger().get_logger(self.__class__.__name__) - else: - self.log = logger - - self.signature = "( {} )".format(self.__class__.__name__) - - def execute(self, *args, env: dict = None) -> bool: - - if not env: - env = os.environ - - # making sure pyton 3.6 is installed at provided path - py36_dir = os.path.normpath(env.get("PYTHON36", "")) - assert os.path.isdir(py36_dir), ( - "Python 3.6 is not installed at the provided folder path. Either " - "make sure the `environments\resolve.json` is having correctly " - "set `PYTHON36` or make sure Python 3.6 is installed " - f"in given path. \nPYTHON36E: `{py36_dir}`" - ) - self.log.info(f"Path to Fusion Python folder: `{py36_dir}`...") - env["PYTHON36"] = py36_dir - - # setting utility scripts dir for scripts syncing - us_dir = os.path.normpath(env.get("FUSION_UTILITY_SCRIPTS_DIR", "")) - assert os.path.isdir(us_dir), ( - "Fusion utility script dir does not exists. Either make sure " - "the `environments\fusion.json` is having correctly set " - "`FUSION_UTILITY_SCRIPTS_DIR` or reinstall DaVinci Resolve. \n" - f"FUSION_UTILITY_SCRIPTS_DIR: `{us_dir}`" - ) - - try: - __import__("avalon.fusion") - __import__("pyblish") - - except ImportError as e: - print(traceback.format_exc()) - print("pyblish: Could not load integration: %s " % e) - - else: - # Resolve Setup integration - importlib.reload(utils) - utils.setup(env) - - return True diff --git a/pype/hooks/resolve/prelaunch.py b/pype/hooks/resolve/prelaunch.py deleted file mode 100644 index 50cfee7a1c..0000000000 --- a/pype/hooks/resolve/prelaunch.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -import traceback -import importlib -from pype.lib import PypeHook -from pype.api import Logger -from pype.hosts.resolve import utils - - -class ResolvePrelaunch(PypeHook): - """ - This hook will check if current workfile path has Resolve - project inside. IF not, it initialize it and finally it pass - path to the project by environment variable to Premiere launcher - shell script. - """ - - def __init__(self, logger=None): - if not logger: - self.log = Logger().get_logger(self.__class__.__name__) - else: - self.log = logger - - self.signature = "( {} )".format(self.__class__.__name__) - - def execute(self, *args, env: dict = None) -> bool: - - if not env: - env = os.environ - - # making sure pyton 3.6 is installed at provided path - py36_dir = os.path.normpath(env.get("PYTHON36_RESOLVE", "")) - assert os.path.isdir(py36_dir), ( - "Python 3.6 is not installed at the provided folder path. Either " - "make sure the `environments\resolve.json` is having correctly " - "set `PYTHON36_RESOLVE` or make sure Python 3.6 is installed " - f"in given path. \nPYTHON36_RESOLVE: `{py36_dir}`" - ) - self.log.info(f"Path to Resolve Python folder: `{py36_dir}`...") - env["PYTHON36_RESOLVE"] = py36_dir - - # setting utility scripts dir for scripts syncing - us_dir = os.path.normpath(env.get("RESOLVE_UTILITY_SCRIPTS_DIR", "")) - assert os.path.isdir(us_dir), ( - "Resolve utility script dir does not exists. Either make sure " - "the `environments\resolve.json` is having correctly set " - "`RESOLVE_UTILITY_SCRIPTS_DIR` or reinstall DaVinci Resolve. \n" - f"RESOLVE_UTILITY_SCRIPTS_DIR: `{us_dir}`" - ) - self.log.debug(f"-- us_dir: `{us_dir}`") - - # correctly format path for pre python script - pre_py_sc = os.path.normpath(env.get("PRE_PYTHON_SCRIPT", "")) - env["PRE_PYTHON_SCRIPT"] = pre_py_sc - self.log.debug(f"-- pre_py_sc: `{pre_py_sc}`...") - try: - __import__("pype.hosts.resolve") - __import__("pyblish") - - except ImportError as e: - print(traceback.format_exc()) - print("pyblish: Could not load integration: %s " % e) - - else: - # Resolve Setup integration - importlib.reload(utils) - self.log.debug(f"-- utils.__file__: `{utils.__file__}`") - utils.setup(env) - - return True