fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ from typing import Any
|
||||
|
||||
from plugins.directus.client import DirectusClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (8 tools)"""
|
||||
return [
|
||||
@@ -201,10 +202,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# HANDLER FUNCTIONS
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_dashboards(
|
||||
client: DirectusClient,
|
||||
filter: dict | None = None,
|
||||
@@ -223,6 +226,7 @@ async def list_dashboards(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_dashboard(client: DirectusClient, id: str) -> str:
|
||||
"""Get dashboard by ID."""
|
||||
try:
|
||||
@@ -233,6 +237,7 @@ async def get_dashboard(client: DirectusClient, id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_dashboard(
|
||||
client: DirectusClient,
|
||||
name: str,
|
||||
@@ -255,6 +260,7 @@ async def create_dashboard(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def update_dashboard(client: DirectusClient, id: str, data: dict[str, Any]) -> str:
|
||||
"""Update dashboard."""
|
||||
try:
|
||||
@@ -267,6 +273,7 @@ async def update_dashboard(client: DirectusClient, id: str, data: dict[str, Any]
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_dashboard(client: DirectusClient, id: str) -> str:
|
||||
"""Delete a dashboard."""
|
||||
try:
|
||||
@@ -275,6 +282,7 @@ async def delete_dashboard(client: DirectusClient, id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_panels(client: DirectusClient, filter: dict | None = None, limit: int = 100) -> str:
|
||||
"""List panels."""
|
||||
try:
|
||||
@@ -286,6 +294,7 @@ async def list_panels(client: DirectusClient, filter: dict | None = None, limit:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_panel(
|
||||
client: DirectusClient,
|
||||
dashboard: str,
|
||||
@@ -323,6 +332,7 @@ async def create_panel(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_panel(client: DirectusClient, id: str) -> str:
|
||||
"""Delete a panel."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user