From a223f049092320bd8899382f44a3c0d5eec4d892 Mon Sep 17 00:00:00 2001 From: furtest Date: Sat, 3 Jan 2026 17:15:22 +0100 Subject: [PATCH] config : take cache_dir_path into account cache_dir_path and all of the OtherConfig was ignored and the default value was loaded, read its value from the config file instead. --- src/unisync/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/unisync/config.py b/src/unisync/config.py index 357bf7e..4e1bf2f 100644 --- a/src/unisync/config.py +++ b/src/unisync/config.py @@ -79,6 +79,7 @@ def load_config(config_path:str) -> Config: # Check if sections are provided server_section = "Server" if "Server" in config.sections() else UNNAMED_SECTION roots_section = "Roots" if "Roots" in config.sections() else UNNAMED_SECTION + other_section = "Other" if "Other" in config.sections() else UNNAMED_SECTION server_config = ServerConfig( config.get(server_section, "user"), @@ -91,6 +92,9 @@ def load_config(config_path:str) -> Config: config.get(roots_section, "local"), config.get(roots_section, "remote") ) + other_config = OtherConfig( + config.get(other_section, "cache_dir_path", fallback=DEFAULT_MISC_CACHE_DIR_PATH) + ) args_bool = list() args_val = dict() @@ -104,4 +108,4 @@ def load_config(config_path:str) -> Config: args_val[key] = val unison_config = UnisonConfig(args_bool, args_val) - return Config(server_config, roots_config, unison_config) + return Config(server_config, roots_config, unison_config, other_config)