diff --git a/server_addon/kitsu/server/__init__.py b/server_addon/kitsu/server/__init__.py deleted file mode 100644 index 69cf812dea0..00000000000 --- a/server_addon/kitsu/server/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Type - -from ayon_server.addons import BaseServerAddon - -from .version import __version__ -from .settings import KitsuSettings, DEFAULT_VALUES - - -class KitsuAddon(BaseServerAddon): - name = "kitsu" - title = "Kitsu" - version = __version__ - settings_model: Type[KitsuSettings] = KitsuSettings - frontend_scopes = {} - services = {} - - async def get_default_settings(self): - settings_model_cls = self.get_settings_model() - return settings_model_cls(**DEFAULT_VALUES) diff --git a/server_addon/kitsu/server/settings.py b/server_addon/kitsu/server/settings.py deleted file mode 100644 index a4d10d889de..00000000000 --- a/server_addon/kitsu/server/settings.py +++ /dev/null @@ -1,112 +0,0 @@ -from pydantic import Field -from ayon_server.settings import BaseSettingsModel - - -class EntityPattern(BaseSettingsModel): - episode: str = Field(title="Episode") - sequence: str = Field(title="Sequence") - shot: str = Field(title="Shot") - - -def _status_change_cond_enum(): - return [ - {"value": "equal", "label": "Equal"}, - {"value": "not_equal", "label": "Not equal"} - ] - - -class StatusChangeCondition(BaseSettingsModel): - condition: str = Field( - "equal", - enum_resolver=_status_change_cond_enum, - title="Condition" - ) - short_name: str = Field("", title="Short name") - - -class StatusChangeProductTypeRequirementModel(BaseSettingsModel): - condition: str = Field( - "equal", - enum_resolver=_status_change_cond_enum, - title="Condition" - ) - product_type: str = Field("", title="Product type") - - -class StatusChangeConditionsModel(BaseSettingsModel): - status_conditions: list[StatusChangeCondition] = Field( - default_factory=list, - title="Status conditions" - ) - product_type_requirements: list[StatusChangeProductTypeRequirementModel] = Field( - default_factory=list, - title="Product type requirements") - - -class CustomCommentTemplateModel(BaseSettingsModel): - enabled: bool = Field(True) - comment_template: str = Field("", title="Custom comment") - - -class IntegrateKitsuNotes(BaseSettingsModel): - """Kitsu supports markdown and here you can create a custom comment template. - - You can use data from your publishing instance's data. - """ - - set_status_note: bool = Field(title="Set status on note") - note_status_shortname: str = Field(title="Note shortname") - status_change_conditions: StatusChangeConditionsModel = Field( - default_factory=StatusChangeConditionsModel, - title="Status change conditions" - ) - custom_comment_template: CustomCommentTemplateModel = Field( - default_factory=CustomCommentTemplateModel, - title="Custom Comment Template", - ) - - -class PublishPlugins(BaseSettingsModel): - IntegrateKitsuNote: IntegrateKitsuNotes = Field( - default_factory=IntegrateKitsuNotes, - title="Integrate Kitsu Note" - ) - - -class KitsuSettings(BaseSettingsModel): - server: str = Field( - "", - title="Kitsu Server", - scope=["studio"], - ) - entities_naming_pattern: EntityPattern = Field( - default_factory=EntityPattern, - title="Entities naming pattern", - ) - publish: PublishPlugins = Field( - default_factory=PublishPlugins, - title="Publish plugins", - ) - - -DEFAULT_VALUES = { - "entities_naming_pattern": { - "episode": "E##", - "sequence": "SQ##", - "shot": "SH##" - }, - "publish": { - "IntegrateKitsuNote": { - "set_status_note": False, - "note_status_shortname": "wfa", - "status_change_conditions": { - "status_conditions": [], - "product_type_requirements": [] - }, - "custom_comment_template": { - "enabled": False, - "comment_template": "{comment}\n\n| | |\n|--|--|\n| version| `{version}` |\n| product type | `{product[type]}` |\n| name | `{name}` |" - } - } - } -} diff --git a/server_addon/kitsu/server/version.py b/server_addon/kitsu/server/version.py deleted file mode 100644 index 485f44ac21b..00000000000 --- a/server_addon/kitsu/server/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.1"