31 lines
675 B
Python
31 lines
675 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
"""调用 doco terms 命令"""
|
||
|
|
import subprocess
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
ep_dir = Path(__file__).resolve().parent
|
||
|
|
repo_root = ep_dir.parent.parent # doco/programs/ep002... -> tps-dashboard
|
||
|
|
|
||
|
|
a_script = ep_dir / "A稿.txt"
|
||
|
|
episode_id = ep_dir.name
|
||
|
|
|
||
|
|
# Use doco CLI directly
|
||
|
|
cmd = [
|
||
|
|
"doco", "terms",
|
||
|
|
"--episode-id", episode_id,
|
||
|
|
"--a-script", str(a_script),
|
||
|
|
]
|
||
|
|
|
||
|
|
print(f"Running: doco terms --episode-id {episode_id} --a-script {a_script}")
|
||
|
|
print(f"CWD: {repo_root}")
|
||
|
|
|
||
|
|
result = subprocess.run(
|
||
|
|
cmd,
|
||
|
|
cwd=str(repo_root),
|
||
|
|
shell=True,
|
||
|
|
encoding="utf-8",
|
||
|
|
errors="replace",
|
||
|
|
)
|
||
|
|
|
||
|
|
print(f"\nExit code: {result.returncode}")
|