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

Function save_settings

deployments/desktop/shared/agents.py:926–951  ·  view source on GitHub ↗
(values: Dict[str, Any])

Source from the content-addressed store, hash-verified

924 return f'"{escaped}"'
925 return text
926
927
928def _env_text(name: str, default: str = "") -> str:
929 file_values = _read_env_file()
930 return str(file_values.get(name, os.environ.get(name, default)) or default).strip()
931
932
933def _configured_reading_notes_git_branch() -> str:
934 return _env_text("PAPERFLOW_READING_NOTES_GIT_BRANCH", "main") or "main"
935
936
937def _normalize_reading_notes_git_remote(remote_url: str) -> str:
938 """Prefer SSH for plain GitHub remotes so GUI sync can use the user's SSH key."""
939 remote = str(remote_url or "").strip()
940 match = re.fullmatch(r"https://github\.com/([^/\s]+)/([^/\s]+?)(?:\.git)?/?", remote)
941 if not match:
942 return remote
943 owner, repo = match.groups()
944 return f"git@github.com:{owner}/{repo}.git"
945
946
947def _configured_reading_notes_git_remote() -> str:
948 return _normalize_reading_notes_git_remote(_env_text("PAPERFLOW_READING_NOTES_GIT_REMOTE", ""))
949
950
951def _default_reading_notes_git_dir() -> Optional[Path]:
952 current_year = datetime.now().year
953 notes_root = _configured_notes_root_dir()
954 if notes_root is not None:

Callers

nothing calls this directly

Calls 2

settingsFunction · 0.85
_merge_env_fileFunction · 0.85

Tested by

no test coverage detected