Skip to content

Commit

Permalink
fix: do not throw an error when target dir does not exist
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl committed Oct 8, 2024
1 parent f7c702d commit 348299e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/antares_web_installer/gui/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/antares_web_installer/gui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 348299e

Please sign in to comment.