- deploy/bot/ — XMPP bot核心(xmpp_agent_core + xmpp_zhiwei_bot) - deploy/profile-scripts/ — cron脚本(price_monitor等) - 运行时文件已替换为指向MoFin的符号链接 - 改代码只需改MoFin,系统自动生效
37 lines
1011 B
Python
37 lines
1011 B
Python
#!/usr/bin/env python3
|
|
"""Wrapper script: generates closing brief report.
|
|
Calls generate_report.py with the 'closing_brief' argument.
|
|
Hermes cron runner does not support script arguments, so this wrapper
|
|
is needed to work around that limitation.
|
|
"""
|
|
import sys
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
script_dir = Path(__file__).parent.resolve()
|
|
target = script_dir / "generate_report.py"
|
|
|
|
if not target.exists():
|
|
print(f"ERROR: generate_report.py not found at {target}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
result = subprocess.run(
|
|
[sys.executable, str(target), "closing_brief"],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=120,
|
|
)
|
|
|
|
if result.stdout:
|
|
print(result.stdout.strip())
|
|
|
|
if result.returncode != 0:
|
|
error_msg = f"Script exited with code {result.returncode}"
|
|
if result.stderr:
|
|
error_msg += f"\nstderr:\n{result.stderr}"
|
|
print(error_msg, file=sys.stderr)
|
|
sys.exit(result.returncode)
|
|
|
|
if result.stderr:
|
|
print(f"stderr:\n{result.stderr}", file=sys.stderr)
|