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 (10 tools)"""
|
||||
return [
|
||||
@@ -302,10 +303,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# Event Tracking Functions (10)
|
||||
# =====================
|
||||
|
||||
|
||||
async def track_event(
|
||||
client: OpenPanelClient,
|
||||
name: str,
|
||||
@@ -340,6 +343,7 @@ async def track_event(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def track_page_view(
|
||||
client: OpenPanelClient,
|
||||
path: str,
|
||||
@@ -384,6 +388,7 @@ async def track_page_view(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def track_screen_view(
|
||||
client: OpenPanelClient,
|
||||
screen_name: str,
|
||||
@@ -425,6 +430,7 @@ async def track_screen_view(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def identify_user(
|
||||
client: OpenPanelClient,
|
||||
profile_id: str,
|
||||
@@ -461,6 +467,7 @@ async def identify_user(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def set_user_properties(
|
||||
client: OpenPanelClient, profile_id: str, properties: dict[str, Any]
|
||||
) -> str:
|
||||
@@ -482,6 +489,7 @@ async def set_user_properties(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def increment_property(
|
||||
client: OpenPanelClient, profile_id: str, property_name: str, value: int = 1
|
||||
) -> str:
|
||||
@@ -519,6 +527,7 @@ async def increment_property(
|
||||
ensure_ascii=False,
|
||||
)
|
||||
|
||||
|
||||
async def decrement_property(
|
||||
client: OpenPanelClient, profile_id: str, property_name: str, value: int = 1
|
||||
) -> str:
|
||||
@@ -556,6 +565,7 @@ async def decrement_property(
|
||||
ensure_ascii=False,
|
||||
)
|
||||
|
||||
|
||||
async def alias_user(client: OpenPanelClient, profile_id: str, alias: str) -> str:
|
||||
"""Create an alias to link two profile IDs"""
|
||||
try:
|
||||
@@ -583,6 +593,7 @@ async def alias_user(client: OpenPanelClient, profile_id: str, alias: str) -> st
|
||||
ensure_ascii=False,
|
||||
)
|
||||
|
||||
|
||||
async def track_revenue(
|
||||
client: OpenPanelClient,
|
||||
amount: float,
|
||||
@@ -629,6 +640,7 @@ async def track_revenue(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def track_batch(
|
||||
client: OpenPanelClient,
|
||||
events: list[dict[str, Any]],
|
||||
|
||||
Reference in New Issue
Block a user