From 250e66ce858e8173bc66f1375f1334c3ade313ca Mon Sep 17 00:00:00 2001 From: Martin Wacker Date: Wed, 19 Jun 2024 15:48:13 +0200 Subject: [PATCH] Revert "Add application and tools enumeration functions." --- ayon_server/settings/enum.py | 44 ------------------------------------ 1 file changed, 44 deletions(-) diff --git a/ayon_server/settings/enum.py b/ayon_server/settings/enum.py index 7a287d57..6ec6164e 100644 --- a/ayon_server/settings/enum.py +++ b/ayon_server/settings/enum.py @@ -99,47 +99,3 @@ async def _get_app_host_names(): async def addon_all_app_host_names_enum(): result = await _get_app_host_names() return [{"label": host_name, "value": host_name} for host_name in result] - - -async def application_enum(apps: list[str] | None = None) -> list[dict[str, str]]: - """Return a list of all applications. - - If app is provided, return only applications that start with app. - - Example: - nuke_variant: str = SettingsField( - default="", - title="Nuke variant", - description="Nuke variant to be used for transcoding.", - enum_resolver=functools.partial(application_enum, "nuke"), - ) - - Args: - app Optional[list[str]]: Application names to filter. Defaults to None. - - Returns: - list[dict]: List of applications. - """ - res = await Postgres.fetch( - "SELECT data FROM attributes WHERE name = 'applications'" - ) - if not res: - return [] - all_apps = res[0]["data"].get("enum", []) - - if apps: - return_apps = [] - for app in apps: - return_apps += [ - a for a in all_apps if a["value"].split("/")[0] == app.lower() - ] - return return_apps - - return all_apps - - -async def tools_enum() -> list[dict[str, str]]: - """Return a list of all tools.""" - res = await Postgres.fetch("SELECT data FROM attributes WHERE name = 'tools'") - - return res[0]["data"].get("enum", []) if res else []