From f8fb015de35414b2cc34ac74ebb67133522f178c Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Wed, 19 Nov 2025 12:24:08 +0100 Subject: [PATCH] Improve docs for config --- biogascontrollerapp.py | 2 +- util/config.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/biogascontrollerapp.py b/biogascontrollerapp.py index 46b4a10..0328f0c 100644 --- a/biogascontrollerapp.py +++ b/biogascontrollerapp.py @@ -208,7 +208,7 @@ if __name__ == "__main__": # Start the application try: - if hasattr(sys, '_MEIPASS'): + if hasattr(sys, "_MEIPASS"): resource_add_path(os.path.join(sys._MEIPASS)) BiogasControllerApp().run() except Exception as e: diff --git a/util/config.py b/util/config.py index 146800d..10f00e6 100644 --- a/util/config.py +++ b/util/config.py @@ -47,11 +47,12 @@ def read_config( key_0: The first key (top level) key_1: The second key (where the actual key-value pair is) default: The default value to return if the check fails - valid_entries: [Optiona] The entries that are valid ones to check against + valid_entries: [Optional] The entries that are valid ones to check against type_to_validate: [Optional] Data type to validate Returns: - [TODO:return] + The read config option as a string. You can cast this to the type you specified with type_to_validate safely. + When converting to a boolean though, use the str_to_bool function provided by this library """ # Try loading the keys tmp = {}