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:
@@ -10,6 +10,7 @@ from typing import Any
|
||||
from plugins.openpanel.client import OpenPanelClient
|
||||
from plugins.openpanel.handlers.utils import get_project_id as _get_project_id
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (10 tools)"""
|
||||
return [
|
||||
@@ -375,10 +376,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# Export Functions (10)
|
||||
# =====================
|
||||
|
||||
|
||||
async def export_events(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
@@ -422,6 +425,7 @@ async def export_events(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def export_events_csv(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
@@ -480,6 +484,7 @@ async def export_events_csv(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def export_chart_data(
|
||||
client: OpenPanelClient,
|
||||
events: list[dict[str, Any]],
|
||||
@@ -517,6 +522,7 @@ async def export_chart_data(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_event_count(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
@@ -555,6 +561,7 @@ async def get_event_count(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_unique_users(
|
||||
client: OpenPanelClient, project_id: str | None = None, date_range: str = "30d"
|
||||
) -> str:
|
||||
@@ -605,6 +612,7 @@ async def get_unique_users(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_page_views(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
@@ -660,6 +668,7 @@ async def get_page_views(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_top_pages(
|
||||
client: OpenPanelClient, project_id: str | None = None, date_range: str = "30d", limit: int = 10
|
||||
) -> str:
|
||||
@@ -707,6 +716,7 @@ async def get_top_pages(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_top_referrers(
|
||||
client: OpenPanelClient, project_id: str | None = None, date_range: str = "30d", limit: int = 10
|
||||
) -> str:
|
||||
@@ -764,6 +774,7 @@ async def get_top_referrers(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_geo_data(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
@@ -827,6 +838,7 @@ async def get_geo_data(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_device_data(
|
||||
client: OpenPanelClient,
|
||||
project_id: str | None = None,
|
||||
|
||||
Reference in New Issue
Block a user