mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
working on settings patching
This commit is contained in:
parent
35e180149b
commit
3b73a8881d
3 changed files with 53 additions and 2 deletions
|
|
@ -1,8 +1,12 @@
|
|||
from typing import Type
|
||||
from typing import Type, Any
|
||||
|
||||
from ayon_server.addons import BaseServerAddon
|
||||
|
||||
from .settings import NukeSettings, DEFAULT_VALUES
|
||||
from .settings import (
|
||||
NukeSettings,
|
||||
DEFAULT_VALUES,
|
||||
convert_settings_overrides
|
||||
)
|
||||
|
||||
|
||||
class NukeAddon(BaseServerAddon):
|
||||
|
|
@ -11,3 +15,13 @@ class NukeAddon(BaseServerAddon):
|
|||
async def get_default_settings(self):
|
||||
settings_model_cls = self.get_settings_model()
|
||||
return settings_model_cls(**DEFAULT_VALUES)
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@ from .main import (
|
|||
NukeSettings,
|
||||
DEFAULT_VALUES,
|
||||
)
|
||||
from .conversion import convert_settings_overrides
|
||||
|
||||
|
||||
__all__ = (
|
||||
"NukeSettings",
|
||||
"DEFAULT_VALUES",
|
||||
|
||||
"convert_settings_overrides",
|
||||
)
|
||||
|
|
|
|||
34
server_addon/nuke/server/settings/conversion.py
Normal file
34
server_addon/nuke/server/settings/conversion.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from typing import Any
|
||||
|
||||
from .publish_plugins import DEFAULT_PUBLISH_VALUES
|
||||
|
||||
|
||||
def _convert_imageio_configs_0_2_2(overrides):
|
||||
"""Image IO settings had changed.
|
||||
|
||||
0.2.2. is the latest version using the old way.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def _convert_extract_intermediate_files_0_2_2(publish_overrides):
|
||||
"""Extract intermediate files settings had changed.
|
||||
|
||||
0.2.2. is the latest version using the old way.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def _convert_publish_plugins(overrides):
|
||||
if "publish" not in overrides:
|
||||
return
|
||||
_convert_extract_intermediate_files_0_2_2(overrides["publish"])
|
||||
|
||||
|
||||
def convert_settings_overrides(
|
||||
source_version: str,
|
||||
overrides: dict[str, Any],
|
||||
) -> dict[str, Any]:
|
||||
_convert_imageio_configs_0_2_2(overrides)
|
||||
_convert_publish_plugins(overrides)
|
||||
return overrides
|
||||
Loading…
Add table
Add a link
Reference in a new issue