Skip to content

Commit

Permalink
revert moving Simple Create Plugins and Editorial Creators
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Dec 3, 2024
1 parent 03df7b3 commit 825ff15
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def __init__(self, *args, **kwargs):

def apply_settings(self, project_settings):
editorial_creators = deepcopy(
project_settings["traypublisher"]["create"]["editorial_creators"]
project_settings["traypublisher"]["editorial_creators"]
)
creator_settings = editorial_creators.get(self.identifier)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize():
project_name = os.environ["AYON_PROJECT_NAME"]
project_settings = get_project_settings(project_name)

simple_creators = project_settings["traypublisher"]["create"]["simple_creators"]
simple_creators = project_settings["traypublisher"]["simple_creators"]

global_variables = globals()
for item in simple_creators:
Expand Down
20 changes: 1 addition & 19 deletions server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
from typing import Any

from ayon_server.addons import BaseServerAddon

from .settings import (
TraypublisherSettings,
DEFAULT_TRAYPUBLISHER_SETTING,
convert_settings_overrides,
)
from .settings import TraypublisherSettings, DEFAULT_TRAYPUBLISHER_SETTING


class Traypublisher(BaseServerAddon):
Expand All @@ -15,15 +9,3 @@ class Traypublisher(BaseServerAddon):
async def get_default_settings(self):
settings_model_cls = self.get_settings_model()
return settings_model_cls(**DEFAULT_TRAYPUBLISHER_SETTING)

async def convert_settings_overrides(
self,
source_version: str,
overrides: dict[str, Any],
) -> dict[str, Any]:
convert_settings_overrides(source_version, overrides)
# Use super conversion
return await super().convert_settings_overrides(
source_version, overrides
)

3 changes: 0 additions & 3 deletions server/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
TraypublisherSettings,
DEFAULT_TRAYPUBLISHER_SETTING,
)
from .conversion import convert_settings_overrides


__all__ = (
"TraypublisherSettings",
"DEFAULT_TRAYPUBLISHER_SETTING",

"convert_settings_overrides",
)
26 changes: 0 additions & 26 deletions server/settings/conversion.py

This file was deleted.

19 changes: 0 additions & 19 deletions server/settings/creator_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
from ayon_server.settings.validators import ensure_unique_names
from ayon_server.exceptions import BadRequestException

from .simple_creators import (
SimpleCreatorPlugin,
DEFAULT_SIMPLE_CREATORS,
)
from .editorial_creators import (
TraypublisherEditorialCreatorPlugins,
DEFAULT_EDITORIAL_CREATORS,
)


class BatchMovieCreatorPlugin(BaseSettingsModel):
"""Allows to publish multiple video files in one go. <br />Name of matching
Expand Down Expand Up @@ -236,14 +227,6 @@ class IngestCSVPluginModel(BaseSettingsModel):


class TrayPublisherCreatePluginsModel(BaseSettingsModel):
simple_creators: list[SimpleCreatorPlugin] = SettingsField(
title="Simple Create Plugins",
default_factory=SimpleCreatorPlugin,
)
editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField(
title="Editorial Creators",
default_factory=TraypublisherEditorialCreatorPlugins,
)
BatchMovieCreator: BatchMovieCreatorPlugin = SettingsField(
title="Batch Movie Creator",
default_factory=BatchMovieCreatorPlugin
Expand All @@ -255,8 +238,6 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel):


DEFAULT_CREATORS = {
"simple_creators": DEFAULT_SIMPLE_CREATORS,
"editorial_creators": DEFAULT_EDITORIAL_CREATORS,
"BatchMovieCreator": {
"default_variants": [
"Main"
Expand Down
19 changes: 18 additions & 1 deletion server/settings/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from ayon_server.settings import BaseSettingsModel, SettingsField

from .imageio import TrayPublisherImageIOModel

from .simple_creators import (
SimpleCreatorPlugin,
DEFAULT_SIMPLE_CREATORS,
)
from .editorial_creators import (
TraypublisherEditorialCreatorPlugins,
DEFAULT_EDITORIAL_CREATORS,
)
from .creator_plugins import (
TrayPublisherCreatePluginsModel,
DEFAULT_CREATORS,
Expand All @@ -18,6 +25,14 @@ class TraypublisherSettings(BaseSettingsModel):
default_factory=TrayPublisherImageIOModel,
title="Color Management (ImageIO)"
)
simple_creators: list[SimpleCreatorPlugin] = SettingsField(
title="Simple Create Plugins",
default_factory=SimpleCreatorPlugin,
)
editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField(
title="Editorial Creators",
default_factory=TraypublisherEditorialCreatorPlugins,
)
create: TrayPublisherCreatePluginsModel = SettingsField(
title="Create",
default_factory=TrayPublisherCreatePluginsModel
Expand All @@ -29,6 +44,8 @@ class TraypublisherSettings(BaseSettingsModel):


DEFAULT_TRAYPUBLISHER_SETTING = {
"simple_creators": DEFAULT_SIMPLE_CREATORS,
"editorial_creators": DEFAULT_EDITORIAL_CREATORS,
"create": DEFAULT_CREATORS,
"publish": DEFAULT_PUBLISH_PLUGINS,
}

0 comments on commit 825ff15

Please sign in to comment.