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:
@@ -5,6 +5,7 @@ from typing import Any
|
||||
|
||||
from plugins.openpanel.client import OpenPanelClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (8 tools)"""
|
||||
return [
|
||||
@@ -183,10 +184,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# Profile Functions (8)
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_profiles(
|
||||
client: OpenPanelClient,
|
||||
project_id: str,
|
||||
@@ -210,6 +213,7 @@ async def list_profiles(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_profile(client: OpenPanelClient, project_id: str, profile_id: str) -> str:
|
||||
"""Get profile details"""
|
||||
try:
|
||||
@@ -249,6 +253,7 @@ async def get_profile(client: OpenPanelClient, project_id: str, profile_id: str)
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def search_profiles(
|
||||
client: OpenPanelClient,
|
||||
project_id: str,
|
||||
@@ -278,6 +283,7 @@ async def search_profiles(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_profile_events(
|
||||
client: OpenPanelClient,
|
||||
project_id: str,
|
||||
@@ -308,6 +314,7 @@ async def get_profile_events(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_profile_sessions(
|
||||
client: OpenPanelClient, project_id: str, profile_id: str, limit: int = 20
|
||||
) -> str:
|
||||
@@ -334,6 +341,7 @@ async def get_profile_sessions(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def delete_profile(
|
||||
client: OpenPanelClient, project_id: str, profile_id: str, confirm: bool = False
|
||||
) -> str:
|
||||
@@ -365,6 +373,7 @@ async def delete_profile(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def merge_profiles(
|
||||
client: OpenPanelClient, project_id: str, primary_profile_id: str, secondary_profile_id: str
|
||||
) -> str:
|
||||
@@ -385,6 +394,7 @@ async def merge_profiles(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def export_profile_data(
|
||||
client: OpenPanelClient, project_id: str, profile_id: str, format: str = "json"
|
||||
) -> str:
|
||||
|
||||
Reference in New Issue
Block a user