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
This commit is contained in:
2025-07-31 11:47:44 +02:00
parent c5992ef19e
commit b35391f1f9

View File

@@ -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:
"""