WIP: Add scaffolding for arch-agnostic base-distro handling

This commit is contained in:
InsanePrawn 2021-09-17 17:56:01 +02:00
parent 044b721edd
commit 232df81901
3 changed files with 105 additions and 1 deletions

View file

@ -152,11 +152,16 @@ class ConfigStateHolder:
# config options that are persisted to file
file: dict = {}
# runtime config not persisted anywhere
runtime: dict = {'verbose': False, 'config_file': None}
runtime: dict = {
'verbose': False,
'config_file': None,
'arch': None,
}
def __init__(self, runtime_conf={}, file_conf_path: str = None, file_conf_base: dict = {}):
"""init a stateholder, optionally loading `file_conf_path`"""
self.runtime.update(runtime_conf)
self.runtime['arch'] = os.uname().machine
self.file.update(file_conf_base)
if file_conf_path:
self.try_load_file(file_conf_path)