Commit Graph

6 Commits

Author SHA1 Message Date
Anna Schumaker 493c4e5c33 lib: Give settigs a initialize() function
For setting a value only if it doesn't already exist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:14 -04:00
Anna Schumaker 76338da8fe lib: Implement save and load functions for settings
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:32:41 -04:00
Anna Schumaker e119a6cf19 lib: Add locking to the settings context manager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:29:47 -04:00
Anna Schumaker 47c688324c lib: Give settings a reset function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:29:44 -04:00
Anna Schumaker 126f03937b lib: Add get_int(), get_float(), and get_bool() functions to settings
The default returns as a string, so this lets callers avoid casting.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:28:40 -04:00
Anna Schumaker 96971317b5 lib: Begin a settings file
Right now I just have functions for set and get wrapped in a context
manager for splitting the setting string into section and key values.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:46:07 -04:00