init_snapshot.py 400 B

123456789
  1. from pathlib import Path
  2. import json, shutil
  3. ROOT=Path(__file__).resolve().parents[1]
  4. SITE=ROOT/'课件'/'EnterpriseKB_RAG_V1.0讲义'
  5. SNAP=ROOT/'course-source'/'legacy-html'
  6. if not (SNAP/'index.html').exists():
  7. for p in SITE.rglob('*.html'):
  8. t=SNAP/p.relative_to(SITE);t.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(p,t)
  9. print('Saved original HTML templates in isolated course-source')