jmcore.config_file
jmcore.config_file
Narrow TOML config access for the shell TUI.
The TUI only needs to read, set, and remove string values in named top-level tables. Keeping that surface here avoids shell parsing and preserves comments and unrelated configuration through TOMLKit.
Classes
ConfigFileError
Bases: Exception
Raised when a config file cannot be safely handled by the TUI.
Source code in jmcore/src/jmcore/config_file.py
23 24 | |
Functions:
get_config_value(path: Path, section: str, key: str) -> str | None
Return a string config value, or None when the file or key is absent.
Source code in jmcore/src/jmcore/config_file.py
56 57 58 59 60 61 62 63 64 65 66 67 | |
main(argv: Sequence[str] | None = None) -> int
Run the TUI config helper command.
Source code in jmcore/src/jmcore/config_file.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
remove_config_value(path: Path, section: str, key: str) -> None
Remove a string config value, doing nothing when the file or key is absent.
Source code in jmcore/src/jmcore/config_file.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
set_config_value(path: Path, section: str, key: str, value: str) -> None
Set a string config value without rewriting the file for a no-op.
Source code in jmcore/src/jmcore/config_file.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |