()
| 469 | } |
| 470 | |
| 471 | |
| 472 | def _reading_report_dirs() -> List[Path]: |
| 473 | configured = Path(_configured_path("PAPERFLOW_READING_REPORTS_DIR", "data/exports")).resolve() |
| 474 | if _env_text("PAPERFLOW_READING_REPORTS_DIR", ""): |
| 475 | return [configured] if configured.exists() and configured.is_dir() else [configured] |
| 476 | fallback = (PROJECT_ROOT / "data" / "reading_reports").resolve() |
| 477 | legacy_exports = (PROJECT_ROOT / "data" / "exports").resolve() |
| 478 | ordered = [configured] |
| 479 | notes_git_dir = _configured_reading_notes_git_dir() |
| 480 | if notes_git_dir is not None: |
| 481 | ordered.append(notes_git_dir.resolve()) |
| 482 | ordered.extend(path.resolve() for path in notes_git_dir.glob("Deep Reading - *") if path.is_dir()) |
| 483 | ordered.extend([fallback, legacy_exports]) |
| 484 | results: List[Path] = [] |
| 485 | seen: Set[str] = set() |
| 486 | for candidate in ordered: |
| 487 | key = str(candidate) |
| 488 | if key in seen: |
| 489 | continue |
| 490 | seen.add(key) |
| 491 | if candidate.exists() and candidate.is_dir(): |
| 492 | results.append(candidate) |
| 493 | if not results: |
| 494 | results.append(configured) |
| 495 | return results |
| 496 | |
| 497 |
no test coverage detected