Commit graph

4 commits

Author SHA1 Message Date
1a267dd2e5 cast.from_env(): Add function
cast.from_env() takes an environment variable name instead of the
string as the first argument and does the obvious thing. It also
takes a default and saves the conversion in case the environment
variable doesn't exist.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-07-05 10:54:30 +02:00
9c13381e7a cast.cast_str_to_timedelta(): Add conversion method
Make cast.from_str() accept time strings.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-05-28 11:12:49 +02:00
296dde387c cast.from_str(): Add as alias to cast_str()
Using cast.from_str('blah') seems more logical than cast.cast_str(),
so add that alias and see how it fares.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-05-28 11:11:11 +02:00
a0234e7d54 Add module jwutils.cast
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-01-16 12:39:20 +01:00