(repo_dir: Path, branch: str, language: str)
| 1425 | return {"format": "markdown", "path": str(output), "display_path": _display_path(output), "count": len(reports) + len(wiki_nodes)} |
| 1426 | |
| 1427 | if normalized == "zip": |
| 1428 | output = root / f"paperflow_{user_id or 'all'}_{timestamp}.zip" |
| 1429 | count = 0 |
| 1430 | with zipfile.ZipFile(output, "w", compression=zipfile.ZIP_DEFLATED) as archive: |
| 1431 | for label, path in _export_sources(): |
| 1432 | if not path.exists(): |
| 1433 | continue |
| 1434 | if path.is_file(): |
| 1435 | archive.write(path, arcname=f"{label}/{path.name}") |
| 1436 | count += 1 |
| 1437 | continue |
| 1438 | for file_path in path.rglob("*"): |
| 1439 | if not file_path.is_file(): |
| 1440 | continue |
| 1441 | if file_path.name.startswith("."): |
| 1442 | continue |
| 1443 | archive.write(file_path, arcname=f"{label}/{file_path.relative_to(path)}") |
| 1444 | count += 1 |
| 1445 | return {"format": "zip", "path": str(output), "display_path": _display_path(output), "count": count} |
| 1446 | |
| 1447 | raise ValueError("export_format must be markdown or zip") |
nothing calls this directly
no test coverage detected