MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _reading_report_dirs

Function _reading_report_dirs

deployments/desktop/shared/agents.py:471–494  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 3

_all_report_recordsFunction · 0.85
list_reportsFunction · 0.85
delete_reportFunction · 0.85

Calls 3

_configured_pathFunction · 0.85
_env_textFunction · 0.85

Tested by

no test coverage detected