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.appwrite.client import AppwriteClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (14 tools)"""
|
||||
return [
|
||||
@@ -361,10 +362,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# HANDLER FUNCTIONS
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_buckets(
|
||||
client: AppwriteClient, queries: list[str] | None = None, search: str | None = None
|
||||
) -> str:
|
||||
@@ -379,6 +382,7 @@ async def list_buckets(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_bucket(client: AppwriteClient, bucket_id: str) -> str:
|
||||
"""Get bucket by ID."""
|
||||
try:
|
||||
@@ -388,6 +392,7 @@ async def get_bucket(client: AppwriteClient, bucket_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_bucket(
|
||||
client: AppwriteClient,
|
||||
bucket_id: str,
|
||||
@@ -424,6 +429,7 @@ async def create_bucket(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def update_bucket(
|
||||
client: AppwriteClient,
|
||||
bucket_id: str,
|
||||
@@ -452,6 +458,7 @@ async def update_bucket(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_bucket(client: AppwriteClient, bucket_id: str) -> str:
|
||||
"""Delete bucket."""
|
||||
try:
|
||||
@@ -463,6 +470,7 @@ async def delete_bucket(client: AppwriteClient, bucket_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_files(
|
||||
client: AppwriteClient,
|
||||
bucket_id: str,
|
||||
@@ -485,6 +493,7 @@ async def list_files(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_file(client: AppwriteClient, bucket_id: str, file_id: str) -> str:
|
||||
"""Get file metadata."""
|
||||
try:
|
||||
@@ -494,6 +503,7 @@ async def get_file(client: AppwriteClient, bucket_id: str, file_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_file(client: AppwriteClient, bucket_id: str, file_id: str) -> str:
|
||||
"""Delete file."""
|
||||
try:
|
||||
@@ -505,6 +515,7 @@ async def delete_file(client: AppwriteClient, bucket_id: str, file_id: str) -> s
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def download_file(client: AppwriteClient, bucket_id: str, file_id: str) -> str:
|
||||
"""Download file content."""
|
||||
try:
|
||||
@@ -524,6 +535,7 @@ async def download_file(client: AppwriteClient, bucket_id: str, file_id: str) ->
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_file_preview(
|
||||
client: AppwriteClient,
|
||||
bucket_id: str,
|
||||
@@ -576,6 +588,7 @@ async def get_file_preview(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_file_view(client: AppwriteClient, bucket_id: str, file_id: str) -> str:
|
||||
"""Get file for viewing."""
|
||||
try:
|
||||
@@ -595,6 +608,7 @@ async def get_file_view(client: AppwriteClient, bucket_id: str, file_id: str) ->
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_file_url(
|
||||
client: AppwriteClient, bucket_id: str, file_id: str, url_type: str = "view"
|
||||
) -> str:
|
||||
@@ -623,6 +637,7 @@ async def get_file_url(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def bulk_delete_files(client: AppwriteClient, bucket_id: str, file_ids: list[str]) -> str:
|
||||
"""Delete multiple files."""
|
||||
try:
|
||||
@@ -650,6 +665,7 @@ async def bulk_delete_files(client: AppwriteClient, bucket_id: str, file_ids: li
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_bucket_stats(client: AppwriteClient, bucket_id: str) -> str:
|
||||
"""Get bucket statistics."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user