diff --git a/src/antares_web_installer/app.py b/src/antares_web_installer/app.py index 283f536..98cc600 100644 --- a/src/antares_web_installer/app.py +++ b/src/antares_web_installer/app.py @@ -170,7 +170,7 @@ def copy_files(self): except PermissionError as e: # pragma: no cover relpath = elt_path.relative_to(self.source_dir).as_posix() raise InstallError(f"Error: Cannot write '{relpath}' in {self.target_dir}: {e}") - except SameFileError as e: + except SameFileError: # test if current file is the installer pass diff --git a/src/antares_web_installer/gui/widgets/frame.py b/src/antares_web_installer/gui/widgets/frame.py index 8aaf505..7830feb 100644 --- a/src/antares_web_installer/gui/widgets/frame.py +++ b/src/antares_web_installer/gui/widgets/frame.py @@ -236,16 +236,15 @@ def __init__(self, master: tk.Misc, window: "WizardView", index: int, *args, **k # Progress Bar values self.current_progress = tk.StringVar(value="Progress: 0%") - ttk.Label(self.body, - textvariable=self.current_progress, - style="Description.TLabel").pack(side="top", fill="x", padx=5) + ttk.Label(self.body, textvariable=self.current_progress, style="Description.TLabel").pack( + side="top", fill="x", padx=5 + ) # Logs display self.current_logs = tk.StringVar(value="") - self.console = ttk.Label(self.body, - textvariable=self.current_logs, - wraplength=window.width, - style="Description.TLabel") + self.console = ttk.Label( + self.body, textvariable=self.current_logs, wraplength=window.width, style="Description.TLabel" + ) self.console.pack(side="top", fill="x", padx=5) # next btn is initially disabled @@ -260,13 +259,13 @@ def progress_update(self, value: float): def on_active_frame(self, event): # Lazy import for typing and testing purposes from antares_web_installer.gui.controller import WizardController + main_logger = logging.getLogger("antares_web_installer.app") # retrieve app logger if isinstance(self.window.controller, WizardController): - # redirect logs in the target `tmp` directory - file_logger = logging.FileHandler(self.window.controller.target_dir.joinpath('tmp/web-installer.log')) + file_logger = logging.FileHandler(self.window.controller.target_dir.joinpath("tmp/web-installer.log")) file_logger.setFormatter(logging.Formatter(FORMAT)) file_logger.setLevel(logging.ERROR) main_logger.addHandler(file_logger) @@ -280,8 +279,9 @@ def on_active_frame(self, event): thread.start() else: main_logger.error(f"Not implemented {type(self.window.controller)}.") - showerror("Error", - "Installer encounters an issue while instantiating controller (code 'NotImplementedError').") + showerror( + "Error", "Installer encounters an issue while instantiating controller (code 'NotImplementedError')." + ) self.window.quit() def on_installation_complete(self, event): @@ -298,7 +298,7 @@ def __init__(self, master: tk.Misc, window: "WizardView", index: int, *args, **k self.body, text="The installation was successfully completed. You can now click on the Finish button " "to close this window.", - style="Description.TLabel" + style="Description.TLabel", ).pack(side="top", fill="x") self.control_btn = ControlFrame(parent=self, window=window, finish_btn=True) diff --git a/src/antares_web_installer/shortcuts/_win32_shell.py b/src/antares_web_installer/shortcuts/_win32_shell.py index ce733c1..0f0fe54 100644 --- a/src/antares_web_installer/shortcuts/_win32_shell.py +++ b/src/antares_web_installer/shortcuts/_win32_shell.py @@ -58,7 +58,7 @@ def create_shortcut( arguments = [arguments] if arguments else [] target_parent, target_name = str(target).rsplit("\\", maxsplit=1) - target_suffix = target_name.split('.')[-1] + target_suffix = target_name.split(".")[-1] target_name = " ".join(re.findall(r"[A-Z][a-z]+", target_name)) new_target = target_parent + "\\" + target_name + "." + target_suffix