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

Function apply_output_scope

paperflow/roles.py:107–122  ·  view source on GitHub ↗

Append role and category directories for local export targets.

(
    path: Path,
    user_id: str,
    *,
    category: str = "",
    project_root: Optional[Path] = None,
)

Source from the content-addressed store, hash-verified

105 aliases = {
106 "pdf": {"pdf", "paper", "papers"},
107 "reading_reports": {"reading-reports", "reading_reports", "reading", "reports"},
108 "monthly_reports": {"monthly-reports", "monthly_reports", "monthly"},
109 "topic_index": {"topic-index", "topic_index", "topic"},
110 }
111 return aliases.get(normalized, {normalized})
112
113
114def apply_output_scope(
115 path: Path,
116 user_id: str,
117 *,
118 category: str = "",
119 project_root: Optional[Path] = None,
120) -> Path:
121 """Append role and category directories for local export targets."""
122 original_labels = _normalized_part_labels(path)
123 scoped = apply_user_scope(path, user_id, project_root=project_root)
124 if not category or not category_storage_subdir_enabled():
125 return scoped

Callers

nothing calls this directly

Calls 5

_normalized_part_labelsFunction · 0.85
apply_user_scopeFunction · 0.85
_category_labelsFunction · 0.85
slugFunction · 0.85

Tested by

no test coverage detected