Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| import argparse | |
| import sys | |
| from pathlib import Path | |
| BACKEND_ROOT = Path(__file__).resolve().parents[1] | |
| if str(BACKEND_ROOT) not in sys.path: | |
| sys.path.insert(0, str(BACKEND_ROOT)) | |
| from services.reference_data_service import sync_reference_resumes_to_local | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="Copy reference resumes into local project storage") | |
| parser.add_argument( | |
| "--max-files", | |
| type=int, | |
| default=120, | |
| help="Maximum number of PDF resumes to copy", | |
| ) | |
| parser.add_argument( | |
| "--source-dir", | |
| type=str, | |
| default=None, | |
| help="Optional source directory containing PDF resumes", | |
| ) | |
| args = parser.parse_args() | |
| summary = sync_reference_resumes_to_local( | |
| max_files=max(1, min(args.max_files, 1000)), | |
| source_dir=args.source_dir, | |
| ) | |
| print("Reference resume sync summary") | |
| print(f"source_dir: {summary['source_dir']}") | |
| print(f"target_dir: {summary['target_dir']}") | |
| print(f"files_seen: {summary['files_seen']}") | |
| print(f"copied: {summary['copied']}") | |
| print(f"skipped: {summary['skipped']}") | |
| if __name__ == "__main__": | |
| main() | |