24 lines
741 B
Python
24 lines
741 B
Python
|
|
# -*- 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"
|
||
|
|
|
||
|
|
# Find docx output dynamically
|
||
|
|
while True:
|
||
|
|
n = len(list(cache_dir.iterdir())) if cache_dir.exists() else 0
|
||
|
|
# Check for any 融合A稿 docx
|
||
|
|
docx_files = list(ep_dir.glob("*融合A稿.docx"))
|
||
|
|
csv_files = list(ep_dir.glob("c4_alignment.csv"))
|
||
|
|
|
||
|
|
print(f"[{time.strftime('%H:%M:%S')}] cache={n}, docx={bool(docx_files)}, csv={bool(csv_files)}")
|
||
|
|
|
||
|
|
if docx_files and csv_files:
|
||
|
|
print(f"\nDone! docx={docx_files[0]}, csv={csv_files[0]}")
|
||
|
|
break
|
||
|
|
|
||
|
|
time.sleep(90)
|
||
|
|
|
||
|
|
print("Complete.")
|