From 5ae6097785672e8b5b9013a03cbabbc4f080b700 Mon Sep 17 00:00:00 2001 From: Maurane GLAUDE Date: Tue, 23 Jul 2024 13:51:08 +0200 Subject: [PATCH] style: reformat code --- src/antares_web_installer/gui/controller.py | 12 ++++++++---- src/antares_web_installer/gui/view.py | 4 ++-- src/antares_web_installer/gui/widgets/frame.py | 3 +-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/antares_web_installer/gui/controller.py b/src/antares_web_installer/gui/controller.py index aac5877..bae503a 100644 --- a/src/antares_web_installer/gui/controller.py +++ b/src/antares_web_installer/gui/controller.py @@ -79,12 +79,16 @@ def install(self): self.app.run() except InstallError as e: logger.error(e) - self.view.raise_error("The installation encountered an error. The target directory may have been " - "corrupted. Please check its integrity and try again.") + self.view.raise_error( + "The installation encountered an error. The target directory may have been " + "corrupted. Please check its integrity and try again." + ) except psutil.NoSuchProcess as e: logger.error(e) - self.view.raise_error("The installation encountered an error. The installation encountered an error while " - "scanning processes. Please retry later.") + self.view.raise_error( + "The installation encountered an error. The installation encountered an error while " + "scanning processes. Please retry later." + ) else: logger.debug("Launch installer worker") logger.debug("Installation complete") diff --git a/src/antares_web_installer/gui/view.py b/src/antares_web_installer/gui/view.py index 9d83b98..e781d2a 100644 --- a/src/antares_web_installer/gui/view.py +++ b/src/antares_web_installer/gui/view.py @@ -59,7 +59,7 @@ def current_index(self, new_index: int): def get_log_file(self): try: return self.controller.log_file - except AttributeError as e: + except AttributeError: self.raise_error("The installer encountered an error while initializing the logger. Please retry later.") def set_geometry(self, width, height): @@ -101,5 +101,5 @@ def change_frame(self): frame.event_generate("<>") def raise_error(self, msg): - showerror('Error', msg) + showerror("Error", msg) self.quit() diff --git a/src/antares_web_installer/gui/widgets/frame.py b/src/antares_web_installer/gui/widgets/frame.py index 9335cc8..16ed3c4 100644 --- a/src/antares_web_installer/gui/widgets/frame.py +++ b/src/antares_web_installer/gui/widgets/frame.py @@ -1,5 +1,4 @@ import logging -import os import tkinter as tk import typing from threading import Thread @@ -316,7 +315,7 @@ def on_installation_complete(self, event): if isinstance(self.window.controller, WizardController): # move log file in application log directory file_name = self.window.controller.log_file.name - log_directory = self.window.controller.target_dir.joinpath('logs') + log_directory = self.window.controller.target_dir.joinpath("logs") self.window.get_log_file().rename(self.window.controller.target_dir.joinpath(log_directory, file_name)) self.control_btn.btns["next"].toggle_btn(True)