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:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from configparser import UNNAMED_SECTION
|
from configparser import UNNAMED_SECTION
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
from pathlib import Path, PosixPath
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
@@ -46,6 +47,13 @@ class UnisonConfig:
|
|||||||
bools: list = field(default_factory=list)
|
bools: list = field(default_factory=list)
|
||||||
values: dict = field(default_factory=dict)
|
values: dict = field(default_factory=dict)
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class OtherConfig:
|
||||||
|
"""
|
||||||
|
Dataclass keeping miscellanous configuration options
|
||||||
|
"""
|
||||||
|
cache_dir_path: PosixPath = Path("~/.unisync").expanduser()
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Config:
|
class Config:
|
||||||
"""
|
"""
|
||||||
@@ -54,6 +62,8 @@ class Config:
|
|||||||
server: ServerConfig
|
server: ServerConfig
|
||||||
roots: RootsConfig
|
roots: RootsConfig
|
||||||
unison: UnisonConfig
|
unison: UnisonConfig
|
||||||
|
other: OtherConfig = field(default_factory=OtherConfig)
|
||||||
|
|
||||||
|
|
||||||
def load_config(config_path:str) -> Config:
|
def load_config(config_path:str) -> Config:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user