From 348299eb3a340273ab777786e2750ecb7e5f7b16 Mon Sep 17 00:00:00 2001 From: Sylvain Leclerc Date: Tue, 8 Oct 2024 16:41:59 +0200 Subject: [PATCH] fix: do not throw an error when target dir does not exist Signed-off-by: Sylvain Leclerc --- src/antares_web_installer/gui/controller.py | 6 ++---- src/antares_web_installer/gui/view.py | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/antares_web_installer/gui/controller.py b/src/antares_web_installer/gui/controller.py index 41b36ee..00ba4ff 100644 --- a/src/antares_web_installer/gui/controller.py +++ b/src/antares_web_installer/gui/controller.py @@ -146,10 +146,8 @@ def install(self, callback: typing.Callable): def get_target_dir(self) -> Path: return self.model.target_dir - def set_target_dir(self, path: Path): - result = self.model.set_target_dir(path) - if not result: - raise ControllerError("Path '{}' is not a directory.".format(path)) + def set_target_dir(self, path: Path) -> None: + self.model.set_target_dir(path) def get_shortcut(self) -> bool: return self.model.shortcut diff --git a/src/antares_web_installer/gui/view.py b/src/antares_web_installer/gui/view.py index a8f7997..2dc140e 100644 --- a/src/antares_web_installer/gui/view.py +++ b/src/antares_web_installer/gui/view.py @@ -154,11 +154,7 @@ def get_target_dir(self) -> Path: return self.controller.get_target_dir() def set_target_dir(self, new_target_dir: str): - try: - self.controller.set_target_dir(Path(new_target_dir)) - except ControllerError as e: - logger.warning("Path is not valid: {}".format(e)) - self.raise_warning("Path selected is not valid") + self.controller.set_target_dir(Path(new_target_dir)) def get_launch(self) -> bool: return self.controller.get_launch()