Create a zip of writer/sections/ contents plus PRIMEarxiv.sty. Does NOT modify the original sections directory (which may be read-only / owned by the sandbox VM user).
(sections_dir: Path, dest_path: Path)
| 311 | # --------------------------------------------------------------------------- |
| 312 | |
| 313 | def _build_zip(sections_dir: Path, dest_path: Path) -> None: |
| 314 | """Create a zip of writer/sections/ contents plus PRIMEarxiv.sty. |
| 315 | |
| 316 | Does NOT modify the original sections directory (which may be |
| 317 | read-only / owned by the sandbox VM user). |
| 318 | """ |
| 319 | with zipfile.ZipFile(dest_path, "w", zipfile.ZIP_DEFLATED) as zf: |
| 320 | if sections_dir.is_dir(): |
| 321 | for f in sorted(sections_dir.iterdir()): |
| 322 | if f.is_file(): |
| 323 | zf.write(f, f.name) |
| 324 | # Always include PRIMEarxiv.sty from the demo source |
| 325 | if PRIMEARXIV_STY.is_file(): |
| 326 | zf.write(PRIMEARXIV_STY, PRIMEARXIV_STY.name) |
| 327 | |
| 328 | |
| 329 | def _compile_pdf(sections_dir: Path) -> Optional[Path]: |