From 1ef7dfbd33a3ace6513b5ab98ddd64a34aa8bcac Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Dec 2020 10:48:13 +0100 Subject: [PATCH] Ftrack module ingerit `ILaunchHookPaths` and has implemented `get_launch_hook_paths` --- pype/modules/ftrack/ftrack_module.py | 20 +++++++++++++++++-- .../launch_hooks}/post_ftrack_changes.py | 0 2 files changed, 18 insertions(+), 2 deletions(-) rename pype/{hooks/global => modules/ftrack/launch_hooks}/post_ftrack_changes.py (100%) diff --git a/pype/modules/ftrack/ftrack_module.py b/pype/modules/ftrack/ftrack_module.py index 44607681ec..d2de27e1b9 100644 --- a/pype/modules/ftrack/ftrack_module.py +++ b/pype/modules/ftrack/ftrack_module.py @@ -3,9 +3,16 @@ from abc import ABCMeta, abstractmethod import six import pype from pype.modules import ( - PypeModule, ITrayModule, IPluginPaths, ITimersManager, IUserModule + PypeModule, + ITrayModule, + IPluginPaths, + ITimersManager, + IUserModule, + ILaunchHookPaths ) +FTRACK_MODULE_DIR = os.path.dirname(os.path.abspath(__file__)) + @six.add_metaclass(ABCMeta) class IFtrackEventHandlerPaths: @@ -19,7 +26,12 @@ class IFtrackEventHandlerPaths: class FtrackModule( - PypeModule, ITrayModule, IPluginPaths, ITimersManager, IUserModule + PypeModule, + ITrayModule, + IPluginPaths, + ITimersManager, + IUserModule, + ILaunchHookPaths ): name = "ftrack" @@ -54,6 +66,10 @@ class FtrackModule( "publish": [os.path.join(pype.PLUGINS_DIR, "ftrack", "publish")] } + def get_launch_hook_paths(self): + """Implementation of `ILaunchHookPaths`.""" + return os.path.join(FTRACK_MODULE_DIR, "launch_hooks") + def connect_with_modules(self, enabled_modules): for module in enabled_modules: if not isinstance(module, IFtrackEventHandlerPaths): diff --git a/pype/hooks/global/post_ftrack_changes.py b/pype/modules/ftrack/launch_hooks/post_ftrack_changes.py similarity index 100% rename from pype/hooks/global/post_ftrack_changes.py rename to pype/modules/ftrack/launch_hooks/post_ftrack_changes.py