Files
tps-dashboard/doco/programs/ep002_20260127_qianting_fangsheng/_wait_compose.py
T

25 lines
689 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
"""轮询等待 C4 compose 完成"""
import time
from pathlib import Path
ep_dir = Path(r"E:\tps-dashboard\doco\programs\ep002_20260127_qianting_fangsheng")
cache_dir = ep_dir / ".c4_cache"
docx_out = ep_dir / "融合A稿.docx"
while True:
if not cache_dir.exists():
print(f"[{time.strftime('%H:%M:%S')}] .c4_cache not yet, waiting 30s...")
time.sleep(30)
continue
n = len(list(cache_dir.iterdir()))
print(f"[{time.strftime('%H:%M:%S')}] cache batches: {n}")
if docx_out.exists():
print(f"\n融合A稿.docx exists! ({docx_out.stat().st_size} bytes)")
break
time.sleep(120)
print("Done.")