From abdaf019ba230709099b05406043c57572e2d10e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 27 Jul 2021 19:01:08 +0200 Subject: [PATCH] interfaces inherit from OpenPypeInterface --- openpype/modules/__init__.py | 13 ++++++++----- openpype/modules/ftrack/ftrack_module.py | 4 ++-- openpype/modules/idle_manager/idle_module.py | 9 ++++++--- openpype/modules/settings_action.py | 9 ++++++--- openpype/modules/timers_manager/timers_manager.py | 11 ++++++++--- openpype/modules/webserver/webserver_module.py | 9 ++++++--- 6 files changed, 36 insertions(+), 19 deletions(-) diff --git a/openpype/modules/__init__.py b/openpype/modules/__init__.py index 3ac11950ef..724f442b74 100644 --- a/openpype/modules/__init__.py +++ b/openpype/modules/__init__.py @@ -2,13 +2,15 @@ from .base import ( PypeModule, OpenPypeInterface, + ModulesManager, + TrayModulesManager +) +from .interfaces import ( ITrayModule, ITrayAction, ITrayService, IPluginPaths, - ILaunchHookPaths, - ModulesManager, - TrayModulesManager + ILaunchHookPaths ) from .settings_action import ( SettingsAction, @@ -47,13 +49,14 @@ __all__ = ( "PypeModule", "OpenPypeInterface", + "ModulesManager", + "TrayModulesManager", + "ITrayModule", "ITrayAction", "ITrayService", "IPluginPaths", "ILaunchHookPaths", - "ModulesManager", - "TrayModulesManager", "SettingsAction", "LocalSettingsAction", diff --git a/openpype/modules/ftrack/ftrack_module.py b/openpype/modules/ftrack/ftrack_module.py index ee139a500e..70f34b6389 100644 --- a/openpype/modules/ftrack/ftrack_module.py +++ b/openpype/modules/ftrack/ftrack_module.py @@ -6,6 +6,7 @@ import six import openpype from openpype.modules import ( PypeModule, + OpenPypeInterface, ITrayModule, IPluginPaths, ITimersManager, @@ -17,8 +18,7 @@ from openpype.settings import SaveWarningExc FTRACK_MODULE_DIR = os.path.dirname(os.path.abspath(__file__)) -@six.add_metaclass(ABCMeta) -class IFtrackEventHandlerPaths: +class IFtrackEventHandlerPaths(OpenPypeInterface): """Other modules interface to return paths to ftrack event handlers. Expected output is dictionary with "server" and "user" keys. diff --git a/openpype/modules/idle_manager/idle_module.py b/openpype/modules/idle_manager/idle_module.py index 5dd5160aa7..57ccc9cce7 100644 --- a/openpype/modules/idle_manager/idle_module.py +++ b/openpype/modules/idle_manager/idle_module.py @@ -4,11 +4,14 @@ from abc import ABCMeta, abstractmethod import six -from openpype.modules import PypeModule, ITrayService +from openpype.modules import ( + PypeModule, + OpenPypeInterface, + ITrayService +) -@six.add_metaclass(ABCMeta) -class IIdleManager: +class IIdleManager(OpenPypeInterface): """Other modules interface to return callbacks by idle time in seconds. Expected output is dictionary with seconds as keys and callback/s diff --git a/openpype/modules/settings_action.py b/openpype/modules/settings_action.py index 9db4a252bc..f6d6463b25 100644 --- a/openpype/modules/settings_action.py +++ b/openpype/modules/settings_action.py @@ -2,11 +2,14 @@ from abc import ABCMeta, abstractmethod import six -from . import PypeModule, ITrayAction +from . import ( + PypeModule, + OpenPypeInterface, + ITrayAction +) -@six.add_metaclass(ABCMeta) -class ISettingsChangeListener: +class ISettingsChangeListener(OpenPypeInterface): """Module has plugin paths to return. Expected result is dictionary with keys "publish", "create", "load" or diff --git a/openpype/modules/timers_manager/timers_manager.py b/openpype/modules/timers_manager/timers_manager.py index 92edd5aeaa..9566f9a6ef 100644 --- a/openpype/modules/timers_manager/timers_manager.py +++ b/openpype/modules/timers_manager/timers_manager.py @@ -2,12 +2,17 @@ import os import collections from abc import ABCMeta, abstractmethod import six -from .. import PypeModule, ITrayService, IIdleManager, IWebServerRoutes +from .. import ( + PypeModule, + OpenPypeInterface, + ITrayService, + IIdleManager, + IWebServerRoutes +) from avalon.api import AvalonMongoDB -@six.add_metaclass(ABCMeta) -class ITimersManager: +class ITimersManager(OpenPypeInterface): timer_manager_module = None @abstractmethod diff --git a/openpype/modules/webserver/webserver_module.py b/openpype/modules/webserver/webserver_module.py index b61619acde..edb0b0be3f 100644 --- a/openpype/modules/webserver/webserver_module.py +++ b/openpype/modules/webserver/webserver_module.py @@ -5,11 +5,14 @@ from abc import ABCMeta, abstractmethod import six from openpype import resources -from .. import PypeModule, ITrayService +from .. import ( + PypeModule, + OpenPypeInterface, + ITrayService +) -@six.add_metaclass(ABCMeta) -class IWebServerRoutes: +class IWebServerRoutes(OpenPypeInterface): """Other modules interface to register their routes.""" @abstractmethod def webserver_initialization(self, server_manager):