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
471
472def _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

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