Skip to content

Commit

Permalink
style: reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
maugde committed Jul 23, 2024
1 parent 8a3d100 commit 5ae6097
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/antares_web_installer/gui/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/antares_web_installer/gui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -101,5 +101,5 @@ def change_frame(self):
frame.event_generate("<<ActivateFrame>>")

def raise_error(self, msg):
showerror('Error', msg)
showerror("Error", msg)
self.quit()
3 changes: 1 addition & 2 deletions src/antares_web_installer/gui/widgets/frame.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import os
import tkinter as tk
import typing
from threading import Thread
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5ae6097

Please sign in to comment.