(file_path: pathlib.Path | None = None)
| 21 | |
| 22 | |
| 23 | def load_config(file_path: pathlib.Path | None = None) -> Config | None: |
| 24 | import tomli |
| 25 | |
| 26 | if file_path is None: |
| 27 | file_path = get_config_path() |
| 28 | if not file_path.exists(): |
| 29 | return |
| 30 | |
| 31 | with file_path.open("rb") as fo: |
| 32 | obj = tomli.load(fo) |
| 33 | return Config.model_validate(obj) |
| 34 | |
| 35 | |
| 36 | def save_config(config: Config, file_path: pathlib.Path | None = None): |