From 053bb8696f342ede8410aea1e1a2dad3cda15cff Mon Sep 17 00:00:00 2001 From: Kharec Date: Sun, 14 Dec 2025 17:15:31 +0100 Subject: [PATCH] feat: add a method to load configuration --- skywipe/configure.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skywipe/configure.py b/skywipe/configure.py index d94cfa6..fff154c 100644 --- a/skywipe/configure.py +++ b/skywipe/configure.py @@ -52,3 +52,10 @@ class Configuration: yaml.dump(config_data, f, default_flow_style=False) print(f"\nConfiguration saved to {self.config_file}") + + def load(self) -> dict: + if not self.exists(): + raise FileNotFoundError( + f"Configuration file not found: {self.config_file}") + with open(self.config_file, "r") as f: + return yaml.safe_load(f)