|
@@ -30,6 +30,26 @@ class Configuration:
|
|
|
else:
|
|
else:
|
|
|
return Path.home() / ".config" / "pc_backup"
|
|
return Path.home() / ".config" / "pc_backup"
|
|
|
|
|
|
|
|
|
|
+ def __str__(self) -> str:
|
|
|
|
|
+ ret = []
|
|
|
|
|
+ ret += ["secret_sources:"]
|
|
|
|
|
+ for s in self.secret_sources:
|
|
|
|
|
+ ret += [f" {s.name}: {s}"]
|
|
|
|
|
+
|
|
|
|
|
+ ret += ["data_sources:"]
|
|
|
|
|
+ for d in self.data_sources:
|
|
|
|
|
+ ret += [f" {d}"]
|
|
|
|
|
+
|
|
|
|
|
+ ret += ["borgmatic setups:"]
|
|
|
|
|
+ for f in self.borgmatic_d_path.iterdir():
|
|
|
|
|
+ ret += [f" {f.name}"]
|
|
|
|
|
+
|
|
|
|
|
+ ret += ["paths:"]
|
|
|
|
|
+ for p in ["borgmatic_d_path", "borgmatic_path", "history_file"]:
|
|
|
|
|
+ ret += [f" {p}: {getattr(self, p)}"]
|
|
|
|
|
+
|
|
|
|
|
+ return "\n".join(ret)
|
|
|
|
|
+
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def read(cls, hostname: str, login: str, config_dir: Path):
|
|
def read(cls, hostname: str, login: str, config_dir: Path):
|
|
|
# The configuration directory has to be organized like this :
|
|
# The configuration directory has to be organized like this :
|