simplefe

Log | Files | Refs

commit 05eac1c2494e5941859d234fbfe12159408e139c
parent 51d4b08de1da2cb3f65656ad5f0f217089c61a4f
Author: Chris Roberts <chris.roberts@learningunix.net>
Date:   Sun, 12 Jul 2026 18:53:42 -0500

Add jobs.toml to load config
Parses [jobs.*] table from a TOML config file and returns it
directly, keeping the on-disk "jobs" wrapper key as an implementation
detail callers don't need to know about.
Tested against fixture data via tmp_path rather than the real
jobs.toml, which is user-specific and gitignored.

Diffstat:
Ajobs.toml.example | 2++
Asrc/simplefe/config.py | 7+++++++
Atests/test_config.py | 12++++++++++++
3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/jobs.toml.example b/jobs.toml.example @@ -0,0 +1,2 @@ +[jobs.example] +path = "/path/to/your/script" diff --git a/src/simplefe/config.py b/src/simplefe/config.py @@ -0,0 +1,7 @@ +import tomllib + + +def load_jobs(path): + with open(path, "rb") as f: + data = tomllib.load(f) + return data["jobs"] diff --git a/tests/test_config.py b/tests/test_config.py @@ -0,0 +1,12 @@ +from simplefe.config import load_jobs + + +def test_load_jobs(tmp_path): + config_file = tmp_path / "jobs.toml" + config_file.write_text(""" + [jobs.rip] + path = ".scripts/rip" + """) + + result = load_jobs(config_file) + assert result == {"rip": {"path": ".scripts/rip"}}