# -*- coding: utf-8 -*- """用 Word 刷新本次新/改的 10 份交付文档目录域(TOC 域缓存为空,需 Word 打开刷新)。""" from __future__ import annotations import subprocess import sys import time from pathlib import Path HERE = Path(__file__).resolve().parent WORKER = HERE / "_word_toc_one.py" TARGET = Path(r"C:\Users\skygu\OneDrive\Projects\AIDOP\项目\项目管理\产互联项目管理\交付文档\Release产互联\待确认") FILES = [ "系统集成业务需求描述-V0.5.docx", "系统集成模块蓝图设计方案-V0.5.docx", "系统集成模块详细设计说明书-V0.5.docx", "系统集成-用户操作手册-V0.5.docx", "运营改善业务需求描述-V0.5.docx", "运营改善模块蓝图设计方案-V0.5.docx", "运营改善模块详细设计说明书-V0.5.docx", "运营改善-用户操作手册-V0.5.docx", "九宫格智慧运营看板模块详细设计说明书-V0.1.docx", "九宫格智慧运营看板-用户操作手册-V0.1.docx", ] def main(): for name in FILES: p = TARGET / name if not p.exists(): print("MISS", name, flush=True) continue t0 = time.time() proc = subprocess.run( [sys.executable, str(WORKER), str(p)], capture_output=True, text=True, timeout=300, check=False, ) out = (proc.stdout or "").strip() err = (proc.stderr or "").strip() status = "OK" if proc.returncode == 0 else "FAIL" print(f"{status} {name} {out or err} {time.time()-t0:.0f}s", flush=True) if __name__ == "__main__": main()