import os, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
base = os.path.dirname(os.path.abspath(__file__))

FILL = [
 ("details/cmu-cdd17fa.html",
  "项目页未公布 GRE/GMAT 要求，待 Tepper admissions 补核，留空不臆造。",
  "GMAT/GRE/EA 其一 required（官网接受 GMAT 新旧版、GRE 新旧版、Executive Assessment；可申请 test waiver，须具突出量化课程；人文社科背景不符合 waiver 条件。录取分布，非最低门槛）。"),
 ("details/uw-c2f6425.html",
  "项目页未列 GRE/GMAT 要求；待系站确认，本页不估算。",
  "GRE 不要求（官网原文：We do not require GRE scores for admission to our data science programs.）。"),
 ("details/geo-bioinformatics-ms.html",
  "本项目页未列 GRE 要求，待补；不臆造。",
  "GRE 不要求、不用于录取（官网原文：GRE scores are not required and are not used in the admission process.）。"),
]

for rel, old, new in FILL:
    p = os.path.join(base, rel.replace("/", os.sep))
    h = open(p, encoding="utf-8").read()
    if old not in h:
        print(f"[WARN] {rel} 旧文本未定位，跳过")
        continue
    h2 = h.replace(old, new, 1)
    open(p, "w", encoding="utf-8").write(h2)
    print(f"[OK] {rel}")
