appconfig module

appconfig

Module for handling app configuration

Copyright (c) 2020 Tom Arn, www.tanapro.ch

For suggestions and questions: <sw@tanapro.ch>

This file is distributed under the terms of the MIT license

tatogalib.util.appconfig.read_config(config_dir, config_default)

Reads the app config from the json file config.json.

When the file does not exist, it is created using the config_default

When config_default contains attributes that do not exist in the json file or when the json file contains attributes that do not exist in config_default, write_config() is called to update the json file.

Parameters:
  • config_dir (Path) – the directory containing the config.json file

  • config_default (dict) – the default config

Returns:

the config dict

Return type:

dict

tatogalib.util.appconfig.write_config(config_dir, config)

Write the app config to the json file config.json.

Parameters:
  • config_dir (Path) – the directory containing the config.json file

  • config (dict) – the config dict

appconfig.version = '1.0.1'
appconfig.version_date = '2021-03-24 - 2023-11-08'