feat(config): Prepare for more metadata
This commit is contained in:
+14
-6
@@ -54,15 +54,19 @@ def default_config() -> ArchMgrConfig:
|
|||||||
"symlinks": [],
|
"symlinks": [],
|
||||||
"template_data": [],
|
"template_data": [],
|
||||||
"themes": {
|
"themes": {
|
||||||
"cursor_theme": "oreo_spark_blue_cursor",
|
"cursor_theme": "oreo_spark_blue_cursor",
|
||||||
"font": "Comfortaa 11",
|
"font": "Comfortaa 11",
|
||||||
"gtk": "Adaptive-Theme",
|
"gtk": "Adaptive-Theme",
|
||||||
"qt": "gtk3",
|
"qt": "gtk3",
|
||||||
"icon_theme": "candy-icons"
|
"icon_theme": "candy-icons",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
requires_list: list[str] = []
|
||||||
|
source_list = {} # for each setting, in which files it appears
|
||||||
|
|
||||||
|
|
||||||
def load_config(file: str) -> ArchMgrConfig:
|
def load_config(file: str) -> ArchMgrConfig:
|
||||||
"""Load the configuration from the specified file path
|
"""Load the configuration from the specified file path
|
||||||
|
|
||||||
@@ -72,6 +76,7 @@ def load_config(file: str) -> ArchMgrConfig:
|
|||||||
Returns:
|
Returns:
|
||||||
The loaded, validated and parsed config
|
The loaded, validated and parsed config
|
||||||
"""
|
"""
|
||||||
|
global requires_list, source_list
|
||||||
# Load and validate initial config
|
# Load and validate initial config
|
||||||
try:
|
try:
|
||||||
loaded_conf = _load_config_file(file)
|
loaded_conf = _load_config_file(file)
|
||||||
@@ -82,6 +87,9 @@ def load_config(file: str) -> ArchMgrConfig:
|
|||||||
|
|
||||||
configuration = cast(dict[str, Any], loaded_conf)
|
configuration = cast(dict[str, Any], loaded_conf)
|
||||||
requires = cast(list[str], configuration.pop("requires"))
|
requires = cast(list[str], configuration.pop("requires"))
|
||||||
|
|
||||||
|
# Keep track of all files
|
||||||
|
requires_list += requires
|
||||||
conf = cast(ArchMgrConfig, configuration)
|
conf = cast(ArchMgrConfig, configuration)
|
||||||
|
|
||||||
# Recursively load files
|
# Recursively load files
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
def update_users_and_groups():
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user