From b35391f1f9f5f0979009a9ad8c3d66d81fd87d1b Mon Sep 17 00:00:00 2001 From: furtest Date: Thu, 31 Jul 2025 11:47:44 +0200 Subject: [PATCH] Adds an Other category to the config This creates a new optionnal category in the config called other that is used to configure various aspects of unison. Currently it only allows to customise the path to the cache directory which is ~/.unisync by default --- src/unisync/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/unisync/config.py b/src/unisync/config.py index f860b7d..0677fb9 100644 --- a/src/unisync/config.py +++ b/src/unisync/config.py @@ -3,6 +3,7 @@ from configparser import UNNAMED_SECTION from dataclasses import dataclass, field +from pathlib import Path, PosixPath import ipaddress import configparser @@ -46,6 +47,13 @@ class UnisonConfig: bools: list = field(default_factory=list) values: dict = field(default_factory=dict) +@dataclass +class OtherConfig: + """ + Dataclass keeping miscellanous configuration options + """ + cache_dir_path: PosixPath = Path("~/.unisync").expanduser() + @dataclass class Config: """ @@ -54,6 +62,8 @@ class Config: server: ServerConfig roots: RootsConfig unison: UnisonConfig + other: OtherConfig = field(default_factory=OtherConfig) + def load_config(config_path:str) -> Config: """