Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack: Removed ftrack interface #2049

Merged
merged 5 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions openpype/modules/default_modules/clockify/clockify_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
from openpype.modules import OpenPypeModule
from openpype_interfaces import (
ITrayModule,
IPluginPaths,
IFtrackEventHandlerPaths
IPluginPaths
)


class ClockifyModule(
OpenPypeModule,
ITrayModule,
IPluginPaths,
IFtrackEventHandlerPaths
IPluginPaths
):
name = "clockify"

Expand Down Expand Up @@ -93,8 +91,8 @@ def get_plugin_paths(self):
"actions": [actions_path]
}

def get_event_handler_paths(self):
"""Implementaton of IFtrackEventHandlerPaths to get plugin paths."""
def get_ftrack_event_handler_paths(self):
"""Function for Ftrack module to add ftrack event handler paths."""
return {
"user": [CLOCKIFY_FTRACK_USER_PATH],
"server": [CLOCKIFY_FTRACK_SERVER_PATH]
Expand Down
15 changes: 11 additions & 4 deletions openpype/modules/default_modules/ftrack/ftrack_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
ITrayModule,
IPluginPaths,
ILaunchHookPaths,
ISettingsChangeListener,
IFtrackEventHandlerPaths
ISettingsChangeListener
)
from openpype.settings import SaveWarningExc

Expand Down Expand Up @@ -81,9 +80,17 @@ def get_launch_hook_paths(self):

def connect_with_modules(self, enabled_modules):
for module in enabled_modules:
if not isinstance(module, IFtrackEventHandlerPaths):
if not hasattr(module, "get_ftrack_event_handler_paths"):
continue

try:
paths_by_type = module.get_ftrack_event_handler_paths()
except Exception:
continue

if not isinstance(paths_by_type, dict):
continue
paths_by_type = module.get_event_handler_paths() or {}

for key, value in paths_by_type.items():
if not value:
continue
Expand Down
12 changes: 0 additions & 12 deletions openpype/modules/default_modules/ftrack/interfaces.py

This file was deleted.

4 changes: 1 addition & 3 deletions openpype/modules/default_modules/ftrack/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
CUST_ATTR_TOOLS,
CUST_ATTR_APPLICATIONS
)
from . settings import (
get_ftrack_url_from_settings,
from .settings import (
get_ftrack_event_mongo_info
)
from .custom_attributes import (
Expand All @@ -31,7 +30,6 @@
"CUST_ATTR_TOOLS",
"CUST_ATTR_APPLICATIONS",

"get_ftrack_url_from_settings",
"get_ftrack_event_mongo_info",

"default_custom_attributes_definition",
Expand Down
9 changes: 0 additions & 9 deletions openpype/modules/default_modules/ftrack/lib/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import os
from openpype.api import get_system_settings


def get_ftrack_settings():
return get_system_settings()["modules"]["ftrack"]


def get_ftrack_url_from_settings():
return get_ftrack_settings()["ftrack_server"]


def get_ftrack_event_mongo_info():
Expand Down