From e3555b2c51364e5b938b7e453687c73b538ca0ea Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Wed, 11 Oct 2023 15:08:33 +0200
Subject: [PATCH] pep8: Fix all pep8 format error.

---
 src/View/BoundaryCondition/Edit/Plot.py       |   2 +-
 src/View/BoundaryCondition/Table.py           |   8 +-
 src/View/CheckList/Window.py                  |   3 +-
 src/View/Frictions/PlotStricklers.py          |   2 +-
 src/View/Frictions/Table.py                   |  12 +-
 src/View/Geometry/PlotAC.py                   |   2 +-
 src/View/Geometry/PlotKPZ.py                  |   2 +-
 src/View/Geometry/PlotXY.py                   |  14 +-
 src/View/Geometry/Profile/Table.py            |   8 +-
 src/View/Geometry/Window.py                   |   4 +-
 src/View/InitialConditions/PlotDKP.py         |   2 +-
 src/View/InitialConditions/PlotDischarge.py   |   2 +-
 src/View/InitialConditions/Table.py           |   5 +-
 src/View/InitialConditions/Window.py          |   4 +-
 src/View/LateralContribution/Edit/Plot.py     |   2 +-
 src/View/LateralContribution/Edit/Window.py   |   6 +-
 src/View/LateralContribution/Table.py         |   8 +-
 src/View/LateralContribution/UndoCommand.py   |   4 +-
 src/View/RunSolver/Window.py                  |   9 +-
 src/View/SedimentLayers/Edit/Plot.py          |   7 +-
 src/View/SedimentLayers/Edit/translate.py     |   3 +-
 src/View/SedimentLayers/Reach/Plot.py         |   2 +-
 src/View/SedimentLayers/Reach/Profile/Plot.py |   2 +-
 .../SedimentLayers/Reach/Profile/Table.py     |   7 +-
 .../SedimentLayers/Reach/Profile/Window.py    |   4 +-
 src/View/SedimentLayers/Reach/Table.py        |   7 +-
 src/View/SedimentLayers/Reach/Window.py       |   4 +-
 src/View/Stricklers/UndoCommand.py            |   4 +-
 src/View/Tools/ASubWindow.py                  |   8 +-
 src/View/Tools/ListedSubWindow.py             |   4 +-
 src/View/Tools/PamhyrDelegate.py              |   5 +-
 src/View/Tools/PamhyrTable.py                 |   8 +-
 src/View/Tools/Plot/OnPickEvent.py            | 120 ++++++++++++------
 src/View/Tools/Plot/PamhyrToolbar.py          |  38 +++++-
 src/init.py                                   |  15 ++-
 src/motd.txt                                  |   7 +
 36 files changed, 229 insertions(+), 115 deletions(-)
 create mode 100644 src/motd.txt

diff --git a/src/View/BoundaryCondition/Edit/Plot.py b/src/View/BoundaryCondition/Edit/Plot.py
index 3c1b8808..bb7a339c 100644
--- a/src/View/BoundaryCondition/Edit/Plot.py
+++ b/src/View/BoundaryCondition/Edit/Plot.py
@@ -128,7 +128,7 @@ class Plot(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/BoundaryCondition/Table.py b/src/View/BoundaryCondition/Table.py
index 3a5afd8f..8aa1a343 100644
--- a/src/View/BoundaryCondition/Table.py
+++ b/src/View/BoundaryCondition/Table.py
@@ -54,7 +54,8 @@ _translate = QCoreApplication.translate
 
 
 class ComboBoxDelegate(QItemDelegate):
-    def __init__(self, data=None, mode="type", tab="", trad=None, parent=None):
+    def __init__(self, data=None, mode="type", tab="",
+                 trad=None, parent=None):
         super(ComboBoxDelegate, self).__init__(parent)
 
         self._data = data
@@ -103,8 +104,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
diff --git a/src/View/CheckList/Window.py b/src/View/CheckList/Window.py
index 1e8fb5d4..0004f3e9 100644
--- a/src/View/CheckList/Window.py
+++ b/src/View/CheckList/Window.py
@@ -97,7 +97,8 @@ class CheckListWindow(PamhyrWindow):
     def setup_connections(self):
         self.find(QPushButton, "pushButton_ok").clicked.connect(self.accept)
         self.find(QPushButton, "pushButton_retry").clicked.connect(self.retry)
-        self.find(QPushButton, "pushButton_cancel").clicked.connect(self.reject)
+        self.find(QPushButton, "pushButton_cancel")\
+            .clicked.connect(self.reject)
 
     def setup_thread(self):
         self._worker = Worker(self._study, self._checker_list)
diff --git a/src/View/Frictions/PlotStricklers.py b/src/View/Frictions/PlotStricklers.py
index 89fe50f8..a65ae896 100644
--- a/src/View/Frictions/PlotStricklers.py
+++ b/src/View/Frictions/PlotStricklers.py
@@ -108,6 +108,6 @@ class PlotStricklers(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
diff --git a/src/View/Frictions/Table.py b/src/View/Frictions/Table.py
index 1cf3dcc1..e1678fdc 100644
--- a/src/View/Frictions/Table.py
+++ b/src/View/Frictions/Table.py
@@ -51,7 +51,8 @@ _translate = QCoreApplication.translate
 
 
 class ComboBoxDelegate(QItemDelegate):
-    def __init__(self, data=None, study=None, mode="stricklers", parent=None):
+    def __init__(self, data=None, study=None,
+                 mode="stricklers", parent=None):
         super(ComboBoxDelegate, self).__init__(parent)
 
         self._data = data
@@ -87,8 +88,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
@@ -116,12 +118,12 @@ class TableModel(PamhyrTableModel):
             return self._lst.get(row).end_kp
         elif self._headers[column] == "begin_strickler":
             value = self._lst.get(row).begin_strickler
-            if value == None:
+            if value is None:
                 return _translate("Frictions", "Not defined")
             return str(value)
         elif self._headers[column] == "end_strickler":
             value = self._lst.get(row).end_strickler
-            if value == None:
+            if value is None:
                 return _translate("Frictions", "Not defined")
             return str(value)
 
diff --git a/src/View/Geometry/PlotAC.py b/src/View/Geometry/PlotAC.py
index b67394c2..1d7bf8d8 100644
--- a/src/View/Geometry/PlotAC.py
+++ b/src/View/Geometry/PlotAC.py
@@ -323,7 +323,7 @@ class PlotAC(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/Geometry/PlotKPZ.py b/src/View/Geometry/PlotKPZ.py
index 983cc798..41b08a8f 100644
--- a/src/View/Geometry/PlotKPZ.py
+++ b/src/View/Geometry/PlotKPZ.py
@@ -170,7 +170,7 @@ class PlotKPZ(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/Geometry/PlotXY.py b/src/View/Geometry/PlotXY.py
index 8c0edcbe..a851cc82 100644
--- a/src/View/Geometry/PlotXY.py
+++ b/src/View/Geometry/PlotXY.py
@@ -141,7 +141,7 @@ class PlotXY(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
@@ -191,8 +191,10 @@ class PlotXY(PamhyrPlot):
             self.after_plot_selected.set_visible(False)
 
             if 0 <= before < self.data.number_profiles:
-                self.before_plot_selected.set_data(self.data.profile(before).x(),
-                                                   self.data.profile(before).y())
+                self.before_plot_selected.set_data(
+                    self.data.profile(before).x(),
+                    self.data.profile(before).y()
+                )
                 self.before_plot_selected.set_visible(True)
 
             if 0 <= ind < self.data.number_profiles:
@@ -201,8 +203,10 @@ class PlotXY(PamhyrPlot):
                 self.plot_selected.set_visible(True)
 
             if 0 <= after < self.data.number_profiles:
-                self.after_plot_selected.set_data(self.data.profile(after).x(),
-                                                  self.data.profile(after).y())
+                self.after_plot_selected.set_data(
+                    self.data.profile(after).x(),
+                    self.data.profile(after).y()
+                )
                 self.after_plot_selected.set_visible(True)
 
         self.canvas.axes.relim()
diff --git a/src/View/Geometry/Profile/Table.py b/src/View/Geometry/Profile/Table.py
index d1a670ac..9c8e7868 100644
--- a/src/View/Geometry/Profile/Table.py
+++ b/src/View/Geometry/Profile/Table.py
@@ -106,9 +106,13 @@ class GeometryProfileTableModel(PamhyrTableModel):
 
                     if role == Qt.ToolTipRole:
                         if value.strip().upper() == "RG":
-                            return _translate("MainWindowProfile", "Rive gauche")
+                            return _translate(
+                                "MainWindowProfile", "Rive gauche"
+                            )
                         else:
-                            return _translate("MainWindowProfile", "Rive droite")
+                            return _translate(
+                                "MainWindowProfile", "Rive droite"
+                            )
 
         return QVariant()
 
diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py
index 201d6d3e..eca958b4 100644
--- a/src/View/Geometry/Window.py
+++ b/src/View/Geometry/Window.py
@@ -139,7 +139,9 @@ class GeometryWindow(PamhyrWindow):
         name = profile.name + " " + str(profile.kp)
 
         return (
-            f"<font color=\"Grey\">{self._trad['reach']}: {self._reach.name}" + " - "
+            "<font color=\"Grey\">" +
+            f"{self._trad['reach']}: {self._reach.name}" +
+            " - " +
             f"{self._trad['cross_section']}:</font> {name}"
         )
 
diff --git a/src/View/InitialConditions/PlotDKP.py b/src/View/InitialConditions/PlotDKP.py
index ccb774da..b81e4cdf 100644
--- a/src/View/InitialConditions/PlotDKP.py
+++ b/src/View/InitialConditions/PlotDKP.py
@@ -74,6 +74,6 @@ class PlotDKP(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
diff --git a/src/View/InitialConditions/PlotDischarge.py b/src/View/InitialConditions/PlotDischarge.py
index d2635a6a..0f918501 100644
--- a/src/View/InitialConditions/PlotDischarge.py
+++ b/src/View/InitialConditions/PlotDischarge.py
@@ -62,6 +62,6 @@ class PlotDischarge(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
diff --git a/src/View/InitialConditions/Table.py b/src/View/InitialConditions/Table.py
index d9546a49..aef6a992 100644
--- a/src/View/InitialConditions/Table.py
+++ b/src/View/InitialConditions/Table.py
@@ -79,8 +79,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
diff --git a/src/View/InitialConditions/Window.py b/src/View/InitialConditions/Window.py
index 5f270599..6fb29ca2 100644
--- a/src/View/InitialConditions/Window.py
+++ b/src/View/InitialConditions/Window.py
@@ -45,7 +45,9 @@ from View.InitialConditions.UndoCommand import (
     DuplicateCommand,
 )
 
-from View.InitialConditions.Table import InitialConditionTableModel, ComboBoxDelegate
+from View.InitialConditions.Table import (
+    InitialConditionTableModel, ComboBoxDelegate,
+)
 
 from View.Tools.Plot.PamhyrCanvas import MplCanvas
 from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar
diff --git a/src/View/LateralContribution/Edit/Plot.py b/src/View/LateralContribution/Edit/Plot.py
index 336b154b..c7e95caa 100644
--- a/src/View/LateralContribution/Edit/Plot.py
+++ b/src/View/LateralContribution/Edit/Plot.py
@@ -124,7 +124,7 @@ class Plot(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/LateralContribution/Edit/Window.py b/src/View/LateralContribution/Edit/Window.py
index c5d12a38..c813a3a9 100644
--- a/src/View/LateralContribution/Edit/Window.py
+++ b/src/View/LateralContribution/Edit/Window.py
@@ -59,12 +59,14 @@ class EditLateralContributionWindow(PamhyrWindow):
         name = self._pamhyr_name
         if self._data is not None:
             edge_name = (self._data.edge.name if self._data.edge is not None
-                         else _translate("LateralContribution", "Not associate"))
+                         else _translate("LateralContribution",
+                                         "Not associate"))
             name = (
                 _translate("Edit lateral contribution", self._pamhyr_name) +
                 f" - {study.name} " +
                 f" - {self._data.name} ({self._data.id}) " +
-                f"({trad.get_dict('long_types')[self._data.lctype]} - {edge_name})"
+                f"({trad.get_dict('long_types')[self._data.lctype]} - " +
+                f"{edge_name})"
             )
 
         super(EditLateralContributionWindow, self).__init__(
diff --git a/src/View/LateralContribution/Table.py b/src/View/LateralContribution/Table.py
index 95d09c9c..060ca8cf 100644
--- a/src/View/LateralContribution/Table.py
+++ b/src/View/LateralContribution/Table.py
@@ -54,7 +54,8 @@ _translate = QCoreApplication.translate
 
 
 class ComboBoxDelegate(QItemDelegate):
-    def __init__(self, data=None, mode="type", tab="", trad=None, parent=None):
+    def __init__(self, data=None, mode="type", tab="",
+                 trad=None, parent=None):
         super(ComboBoxDelegate, self).__init__(parent)
 
         self._data = data
@@ -98,8 +99,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
diff --git a/src/View/LateralContribution/UndoCommand.py b/src/View/LateralContribution/UndoCommand.py
index 198fd959..382ae1ac 100644
--- a/src/View/LateralContribution/UndoCommand.py
+++ b/src/View/LateralContribution/UndoCommand.py
@@ -24,7 +24,9 @@ from PyQt5.QtWidgets import (
 )
 
 from Model.LateralContribution.LateralContribution import LateralContribution
-from Model.LateralContribution.LateralContributionList import LateralContributionList
+from Model.LateralContribution.LateralContributionList import (
+    LateralContributionList
+)
 
 
 class SetNameCommand(QUndoCommand):
diff --git a/src/View/RunSolver/Window.py b/src/View/RunSolver/Window.py
index 2adfce60..dcf39b5c 100644
--- a/src/View/RunSolver/Window.py
+++ b/src/View/RunSolver/Window.py
@@ -48,7 +48,7 @@ from View.RunSolver.Log.Window import SolverLogFileWindow
 try:
     from signal import SIGTERM, SIGSTOP, SIGCONT
     _signal = True
-except:
+except Exception:
     _signal = False
 
 _translate = QCoreApplication.translate
@@ -83,7 +83,8 @@ class SelectSolverWindow(PamhyrDialog):
 
     def setup_connections(self):
         self.find(QPushButton, "pushButton_run").clicked.connect(self.accept)
-        self.find(QPushButton, "pushButton_cancel").clicked.connect(self.reject)
+        self.find(QPushButton, "pushButton_cancel")\
+            .clicked.connect(self.reject)
 
     @property
     def solver(self):
@@ -181,7 +182,7 @@ class SolverLogWindow(PamhyrWindow):
         self._alarm.timeout.connect(self.update)
 
     def _log(self, msg, color=None):
-        if type(msg) == str:
+        if msg is str:
             msg = msg.rsplit('\n')[0]
 
             if color is not None:
@@ -189,7 +190,7 @@ class SolverLogWindow(PamhyrWindow):
 
             self.find(QTextEdit, "textEdit").append(msg)
 
-        elif type(msg) == int:
+        elif msg is int:
             color = "blue" if msg == 0 else "red"
             self.find(QTextEdit, "textEdit")\
                 .append(f"<font color=\"{color}\">" +
diff --git a/src/View/SedimentLayers/Edit/Plot.py b/src/View/SedimentLayers/Edit/Plot.py
index 9a9baed3..87cfe644 100644
--- a/src/View/SedimentLayers/Edit/Plot.py
+++ b/src/View/SedimentLayers/Edit/Plot.py
@@ -11,8 +11,9 @@ logger = logging.getLogger()
 
 
 class Plot(PamhyrPlot):
-    def __init__(self, canvas=None, trad=None, data=None, toolbar=None,
-                 display_current=True, parent=None):
+    def __init__(self, canvas=None, trad=None, data=None,
+                 toolbar=None, display_current=True,
+                 parent=None):
         super(Plot, self).__init__(
             canvas=canvas,
             trad=trad,
@@ -88,7 +89,7 @@ class Plot(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/SedimentLayers/Edit/translate.py b/src/View/SedimentLayers/Edit/translate.py
index ce036b8d..8c174ea3 100644
--- a/src/View/SedimentLayers/Edit/translate.py
+++ b/src/View/SedimentLayers/Edit/translate.py
@@ -19,5 +19,6 @@ class SedimentEditTranslate(SedimentTranslate):
             "height": _translate("SedimentLayers", "Height"),
             "d50": _translate("SedimentLayers", "D50"),
             "sigma": _translate("SedimentLayers", "Sigma"),
-            "critical_constraint": _translate("SedimentLayers", "Critical constraint"),
+            "critical_constraint": _translate("SedimentLayers",
+                                              "Critical constraint"),
         }
diff --git a/src/View/SedimentLayers/Reach/Plot.py b/src/View/SedimentLayers/Reach/Plot.py
index 0db3b4e2..3664081c 100644
--- a/src/View/SedimentLayers/Reach/Plot.py
+++ b/src/View/SedimentLayers/Reach/Plot.py
@@ -91,7 +91,7 @@ class Plot(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/SedimentLayers/Reach/Profile/Plot.py b/src/View/SedimentLayers/Reach/Profile/Plot.py
index 062070ac..38adb990 100644
--- a/src/View/SedimentLayers/Reach/Profile/Plot.py
+++ b/src/View/SedimentLayers/Reach/Profile/Plot.py
@@ -90,7 +90,7 @@ class Plot(PamhyrPlot):
 
     @timer
     def update(self, ind=None):
-        if self._init == False:
+        if not self._init:
             self.draw()
             return
 
diff --git a/src/View/SedimentLayers/Reach/Profile/Table.py b/src/View/SedimentLayers/Reach/Profile/Table.py
index fbdfb042..3754aa82 100644
--- a/src/View/SedimentLayers/Reach/Profile/Table.py
+++ b/src/View/SedimentLayers/Reach/Profile/Table.py
@@ -61,8 +61,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
@@ -86,7 +87,7 @@ class TableModel(PamhyrTableModel):
             return self._data.point(row).name
         elif self._headers[column] == "sl":
             value = self._data.point(row).sl
-            if value == None:
+            if value is None:
                 text = _translate("SedimentLayers", "Not defined")
                 return text
             return str(value)
diff --git a/src/View/SedimentLayers/Reach/Profile/Window.py b/src/View/SedimentLayers/Reach/Profile/Window.py
index 1dcbd0a8..22ca8fcb 100644
--- a/src/View/SedimentLayers/Reach/Profile/Window.py
+++ b/src/View/SedimentLayers/Reach/Profile/Window.py
@@ -30,7 +30,9 @@ from View.SedimentLayers.Reach.Profile.Plot import Plot
 from View.Tools.Plot.PamhyrCanvas import MplCanvas
 from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar
 
-from View.SedimentLayers.Reach.Profile.translate import SedimentProfileTranslate
+from View.SedimentLayers.Reach.Profile.translate import (
+    SedimentProfileTranslate
+)
 from View.SedimentLayers.Window import SedimentLayersWindow
 
 _translate = QCoreApplication.translate
diff --git a/src/View/SedimentLayers/Reach/Table.py b/src/View/SedimentLayers/Reach/Table.py
index 7e38fcc8..71889408 100644
--- a/src/View/SedimentLayers/Reach/Table.py
+++ b/src/View/SedimentLayers/Reach/Table.py
@@ -61,8 +61,9 @@ class ComboBoxDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
@@ -88,7 +89,7 @@ class TableModel(PamhyrTableModel):
             return self._data.profile(row).kp
         if self._headers[column] == "sl":
             value = self._data.profile(row).sl
-            if value == None:
+            if value is None:
                 text = _translate("SedimentLayers", "Not defined")
                 return text
             return str(value)
diff --git a/src/View/SedimentLayers/Reach/Window.py b/src/View/SedimentLayers/Reach/Window.py
index 9c400909..6c4cad96 100644
--- a/src/View/SedimentLayers/Reach/Window.py
+++ b/src/View/SedimentLayers/Reach/Window.py
@@ -33,7 +33,9 @@ from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar
 
 from View.SedimentLayers.Reach.translate import SedimentReachTranslate
 from View.SedimentLayers.Window import SedimentLayersWindow
-from View.SedimentLayers.Reach.Profile.Window import ProfileSedimentLayersWindow
+from View.SedimentLayers.Reach.Profile.Window import (
+    ProfileSedimentLayersWindow
+)
 
 _translate = QCoreApplication.translate
 
diff --git a/src/View/Stricklers/UndoCommand.py b/src/View/Stricklers/UndoCommand.py
index 00aedb21..b543b046 100644
--- a/src/View/Stricklers/UndoCommand.py
+++ b/src/View/Stricklers/UndoCommand.py
@@ -24,7 +24,9 @@ from PyQt5.QtWidgets import (
 )
 
 from Model.LateralContribution.LateralContribution import LateralContribution
-from Model.LateralContribution.LateralContributionList import LateralContributionList
+from Model.LateralContribution.LateralContributionList import (
+    LateralContributionList
+)
 
 
 class SetNameCommand(QUndoCommand):
diff --git a/src/View/Tools/ASubWindow.py b/src/View/Tools/ASubWindow.py
index aa95ddcd..a2e8fc88 100644
--- a/src/View/Tools/ASubWindow.py
+++ b/src/View/Tools/ASubWindow.py
@@ -70,8 +70,8 @@ class WindowToolKit(object):
 
         stream = StringIO(data)
         rows = csv.reader(stream, delimiter='\t')
-        for l, row in enumerate(rows):
-            if has_header and l == 0:
+        for ind, row in enumerate(rows):
+            if has_header and ind == 0:
                 header = row.copy()
                 continue
 
@@ -79,7 +79,9 @@ class WindowToolKit(object):
 
         return header, values
 
-    def file_dialog(self, select_file=True, callback=lambda x: None, directory=None):
+    def file_dialog(self, select_file=True,
+                    callback=lambda x: None,
+                    directory=None):
         """Open a new file dialog and send result to callback function
 
         Args:
diff --git a/src/View/Tools/ListedSubWindow.py b/src/View/Tools/ListedSubWindow.py
index 5a6c132c..b548cb31 100644
--- a/src/View/Tools/ListedSubWindow.py
+++ b/src/View/Tools/ListedSubWindow.py
@@ -40,7 +40,7 @@ class ListedSubWindow(object):
         try:
             logger.info(
                 f"Open window: {name}: {self.sub_win_cnt}: {win.hash()}")
-        except:
+        except Exception:
             logger.info(f"Open window: {name}: {self.sub_win_cnt}: X")
 
     def sub_win_del(self, name):
@@ -98,5 +98,5 @@ class ListedSubWindow(object):
                     self.sub_win_list,
                 )
             )[1]
-        except:
+        except Exception:
             return None
diff --git a/src/View/Tools/PamhyrDelegate.py b/src/View/Tools/PamhyrDelegate.py
index c253ec25..9d68c908 100644
--- a/src/View/Tools/PamhyrDelegate.py
+++ b/src/View/Tools/PamhyrDelegate.py
@@ -62,8 +62,9 @@ class PamhyrExTimeDelegate(QItemDelegate):
 
     def updateEditorGeometry(self, editor, option, index):
         r = QRect(option.rect)
-        if self.editor.windowFlags() & Qt.Popup and editor.parent() is not None:
-            r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
+        if self.editor.windowFlags() & Qt.Popup:
+            if editor.parent() is not None:
+                r.setTopLeft(self.editor.parent().mapToGlobal(r.topLeft()))
         editor.setGeometry(r)
 
     @pyqtSlot()
diff --git a/src/View/Tools/PamhyrTable.py b/src/View/Tools/PamhyrTable.py
index ff815624..b77e26b9 100644
--- a/src/View/Tools/PamhyrTable.py
+++ b/src/View/Tools/PamhyrTable.py
@@ -109,7 +109,8 @@ class PamhyrTableModel(QAbstractTableModel):
     def _table_view_configure(self):
         self._table_view.setModel(self)
         self._table_view.setSelectionBehavior(QAbstractItemView.SelectRows)
-        self._table_view.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
+        self._table_view.horizontalHeader()\
+                        .setSectionResizeMode(QHeaderView.Stretch)
         self._table_view.setAlternatingRowColors(True)
         self._table_view.resizeColumnsToContents()
 
@@ -131,8 +132,9 @@ class PamhyrTableModel(QAbstractTableModel):
         return len(self._headers)
 
     def headerData(self, section, orientation, role):
-        if role == Qt.ItemDataRole.DisplayRole and orientation == Qt.Orientation.Horizontal:
-            return self._table_headers[self._headers[section]]
+        if role == Qt.ItemDataRole.DisplayRole:
+            if orientation == Qt.Orientation.Horizontal:
+                return self._table_headers[self._headers[section]]
 
         return QVariant()
 
diff --git a/src/View/Tools/Plot/OnPickEvent.py b/src/View/Tools/Plot/OnPickEvent.py
index e02c897d..87ab0758 100644
--- a/src/View/Tools/Plot/OnPickEvent.py
+++ b/src/View/Tools/Plot/OnPickEvent.py
@@ -75,8 +75,11 @@ class OnpickEvent(object):
     def select_row_pt_clicked(self, ind: int = 0):
         """
         Args:
-             ind: Indice de la ligne où se trouve le point le plus proche 'visé'.
-        Returns: Sélectionne la ligne (du tableau) correspondant au point le plus proche 'visé' à la suite de l'événement onpick.
+             ind: Indice de la ligne où se trouve le point le plus proche
+                  'visé'.
+
+        Returns: Sélectionne la ligne (du tableau) correspondant au point le
+                 plus proche 'visé' à la suite de l'événement onpick.
         """
         if self.tableView is not None:
             selectionModel = self.tableView.selectionModel()
@@ -98,7 +101,8 @@ class OnpickEvent(object):
 
     def select_point_plot(self):
         """
-        Returns: sélectionne le(s) point(s) du graphique correspondant à la/aux ligne(s) sélectionnée(s) dans le tableau.
+        Returns: sélectionne le(s) point(s) du graphique correspondant à
+                 la/aux ligne(s) sélectionnée(s) dans le tableau.
         """
         if self.tableView is not None:
             rows = list(set(
@@ -125,15 +129,17 @@ class OnpickEvent(object):
                     try:
                         [pl[0].set_data([], [])
                          for pl in self.pt if len(self.pt) > 1]
-                    except:
+                    except Exception:
                         logger.info("update_select_point_point: Update issue")
 
                     try:
                         self.update_select_point_point_bis(self.x[row],
                                                            self.y[row])
-                    except:
+                    except Exception:
                         logger.info(
-                            "update_select_point_point_bis: Update issue, possible index missing")
+                            "update_select_point_point_bis: Update issue, " +
+                            "possible index missing"
+                        )
 
             self.ax.figure.canvas.draw_idle()
 
@@ -150,13 +156,18 @@ class OnpickEvent(object):
     def plot_selection_point(self, x, y):
         """
         Args:
-            x: abscisse
-            y: ordonnée
-        Returns: sélectionne le point du graphique correspond à la ligne sélectionnée dans le tableau.
+            x: abscissa
+            y: ordinate
+
+        Returns: sélectionne le point du graphique correspond à la ligne
+                 sélectionnée dans le tableau.
         """
         if self.tableView is not None:
-            self.select_point, = self.ax.plot(x, y,
-                                              '+', c='Blue', markersize=7)
+            self.select_point, = self.ax.plot(
+                x, y,
+                '+', c='Blue',
+                markersize=7
+            )
         else:
             self.select_point, = self.ax.plot([], [])
 
@@ -210,7 +221,8 @@ class OnpickEvent(object):
     @property
     def delta_x(self):
         """"
-        Returns: la longueur entre les limites de la vue sur l'axe des x, c'est-à-dire |x_max_visible - x_min_visible|.
+        Returns: la longueur entre les limites de la vue sur l'axe des x,
+                 c'est-à-dire |x_max_visible - x_min_visible|.
         """
         xgauche, xdroite = self.ax.get_xlim()
         delta_x = abs(xdroite - xgauche)
@@ -219,7 +231,8 @@ class OnpickEvent(object):
     @property
     def delta_y(self):
         """
-        Returns: la longueur entre les limites de la vue sur l'axe des y, c'est à dire |y_max_visible - y_min_visible|.
+        Returns: la longueur entre les limites de la vue sur l'axe des y,
+                 c'est à dire |y_max_visible - y_min_visible|.
         """
         ybas, yhaut = self.ax.get_ylim()
         delta_y = abs(yhaut - ybas)
@@ -229,8 +242,9 @@ class OnpickEvent(object):
     def indice_points_onpick(event):
         """
         Args: event
-        Returns: le(s) indexe(s) du/des point(s) (plus précisement les coordonnées de points) capturé(s)
-                 par l'événement onpick (voir picker)
+        Returns: le(s) indexe(s) du/des point(s) (plus précisement les
+                 coordonnées de points) capturé(s) par l'événement onpick
+                 (voir picker)
         """
         return event.ind
 
@@ -238,9 +252,9 @@ class OnpickEvent(object):
         """
         Args:
             event:
-        Returns: une array contenant les coordonées des points qui se trouvent dans la zone définie par l'événement
-        onpick (voir picker)
-
+        Returns: une array contenant les coordonées des points qui se
+                 trouvent dans la zone définie par l'événement onpick
+                 (voir picker)
         """
         thisline = event.artist
         xdata = thisline.get_xdata()
@@ -254,8 +268,9 @@ class OnpickEvent(object):
         """
         Args:
             event:
-        Returns: la liste des distances normées (en m) entre les points situés dans la région définie par l'événement
-         onpick (voir picker).
+        Returns: la liste des distances normées (en m) entre les points
+                 situés dans la région définie par l'événement onpick
+                 (voir picker).
         """
         ind = event.ind
         thisline = event.artist
@@ -282,15 +297,23 @@ class OnpickEvent(object):
         """
         Args:
             event:
-        Returns: la liste des distances 'visuelles' entre les points situés dans la région définie par l'événement
-        onpick (voir picker).
+        Returns: la liste des distances 'visuelles' entre les points situés
+                 dans la région définie par l'événement onpick (voir picker).
         """
         bbox = self.ax.get_window_extent()\
                       .transformed(self.ax.figure.dpi_scale_trans.inverted())
         ratio_w_sur_h = bbox.width / bbox.height
         distances_ecran = [
-            (((x - event.mouseevent.xdata) / (self.delta_x * ratio_w_sur_h)) ** 2 +
-             ((y - event.mouseevent.ydata) / self.delta_y) ** 2) ** (1 / 2)
+            (
+                (
+                    (x - event.mouseevent.xdata) /
+                    (self.delta_x * ratio_w_sur_h)
+                ) ** 2 +
+                (
+                    (y - event.mouseevent.ydata) /
+                    self.delta_y
+                ) ** 2
+            ) ** (1 / 2)
             for (x, y) in self.points_onpick(event)
         ]
 
@@ -298,9 +321,11 @@ class OnpickEvent(object):
 
     def distances(self, event):
         """
-        Args: event:
-        Returns: la liste des distances entre la position de la souris et tous les points se trouvant dans
-        la zone définie par l'événement onpick ( voir picker)
+        Args:
+            event:
+        Returns: la liste des distances entre la position de la souris et
+                 tous les points se trouvant dans la zone définie par
+                 l'événement onpick (voir picker)
         """
         distances = np.linalg.norm(
             self.points_onpick(event) - self.position_souris(event),
@@ -311,18 +336,23 @@ class OnpickEvent(object):
 
     def index_pt_plus_proche_ecran(self, event):
         """
-         Args:
-             event:
-         Returns: indice du point le plus proche visuellement de la position du click.
-         """
+        Args:
+            event:
+        Returns: indice du point le plus proche visuellement de la position
+                 du click.
+        """
         dataidx_ecran = np.argmin(self.distance_ecran(event))
         return dataidx_ecran
 
     def point_plus_proche_ecran(self, event):
         point_onpick = self.points_onpick(event)
-        datapos_ecran = point_onpick[self.index_pt_plus_proche_ecran(event)]
+        datapos_ecran = point_onpick[
+            self.index_pt_plus_proche_ecran(event)
+        ]
 
-        return self.points_onpick(event)[self.index_pt_plus_proche_ecran(event)]
+        return self.points_onpick(event)[
+            self.index_pt_plus_proche_ecran(event)
+        ]
 
     def index_pt_plus_proche(self, event):
         """
@@ -408,8 +438,10 @@ class OnpickEvent(object):
                 cte = event.y * 0.1 / 100
 
             self.y_pos_text_param_hydrau = event.ydata + cte
-            self.annotation_onclick.set_position((self.pos_x_annotation,
-                                                  self.y_pos_text_param_hydrau))
+            self.annotation_onclick.set_position(
+                (self.pos_x_annotation,
+                 self.y_pos_text_param_hydrau)
+            )
 
             self.ax.callbacks.connect('ylim_changed', self.on_ylims_change)
 
@@ -454,7 +486,7 @@ class OnpickEvent(object):
                     try:
                         self.poly_col_bis.remove()
                         self.largeur_au_miroir(event)
-                    except:
+                    except Exception:
                         self.largeur_au_miroir(event)
 
                 self.annotate_onclick(event)
@@ -477,7 +509,8 @@ class OnpickEvent(object):
         """
         Args:
             val: Valeur de la cote Z à laquelle on veut caluler A , p et L.
-        Returns: la valeur de la section mouillée A, du périmètre mouillé p et de la largeur au miroir L.
+        Returns: la valeur de la section mouillée A, du périmètre mouillé p
+                 et de la largeur au miroir L.
         """
         largeur_miroir = 0.
         section_mouillee_totale = 0.
@@ -495,7 +528,10 @@ class OnpickEvent(object):
             perimetre_shapely = 0.
             perim_calc = 0.
 
-            for polyg, coul in zip(liste_chemins, couleurs[0:len(liste_chemins)]):
+            for polyg, coul in zip(
+                    liste_chemins,
+                    couleurs[0:len(liste_chemins)]
+            ):
                 points_polygone = polyg.vertices
                 xs = points_polygone[:, 0]
                 ys = points_polygone[:, 1]
@@ -510,7 +546,9 @@ class OnpickEvent(object):
                 polygone_shapely = ShapelyPolygon(points_polygone)
                 aire_calculee_shapely = polygone_shapely.area
                 perimetre_shapely = polygone_shapely.length
-                perimetre_mouille_total_shapely = polygone_shapely.length - largeur_miroir
+                perimetre_mouille_total_shapely = (
+                    polygone_shapely.length - largeur_miroir
+                )
                 liste_points_fond = [
                     (x, y) for (x, y) in zip(xs, ys) if not np.isclose(y, val)
                 ]
@@ -519,7 +557,9 @@ class OnpickEvent(object):
                 perimetre = 0
                 aire = 0
 
-                for un_point in liste_points_fond + [(min(liste_points_miroir), val)]:
+                for un_point in liste_points_fond + [
+                        (min(liste_points_miroir), val)
+                ]:
                     x_pt_suivant, y_pt_suivant = un_point
                     perimetre += ((x_pt_prec - x_pt_suivant) ** 2 +
                                   (y_pt_prec - y_pt_suivant) ** 2) ** (1 / 2)
diff --git a/src/View/Tools/Plot/PamhyrToolbar.py b/src/View/Tools/Plot/PamhyrToolbar.py
index 7d769d32..977087d0 100644
--- a/src/View/Tools/Plot/PamhyrToolbar.py
+++ b/src/View/Tools/Plot/PamhyrToolbar.py
@@ -39,7 +39,8 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
     """
     isometric_signal = pyqtSignal(str)
 
-    def __init__(self, canvas, parent, items=["home", "move", "zoom", "save"]):
+    def __init__(self, canvas, parent,
+                 items=["home", "move", "zoom", "save"]):
         """PamhyrPlotToolbar
 
         Args:
@@ -57,12 +58,22 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
 
         if "home" in items:
             self.toolitems.append(
-                ('Home', _translate("Toolbar", 'Default view'), 'home', 'home'))
+                (
+                    'Home',
+                    _translate("Toolbar", 'Default view'),
+                    'home', 'home'
+                )
+            )
             self.toolitems.append((None, None, None, None))
 
         if "back/forward" in items:
             self.toolitems.append(
-                ('Back', _translate("Toolbar", 'Back to previous view'), 'back', 'back'))
+                (
+                    'Back',
+                    _translate("Toolbar", 'Back to previous view'),
+                    'back', 'back'
+                )
+            )
             self.toolitems.append(('Forward', _translate(
                 "Toolbar", 'Return to next view'), 'forward', 'forward'))
             self.toolitems.append((None, None, None, None))
@@ -77,7 +88,12 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
 
         if "zoom" in items:
             self.toolitems.append(
-                ('Zoom', _translate("Toolbar", 'Zoom'), 'zoom_to_rect', 'zoom'))
+                (
+                    'Zoom',
+                    _translate("Toolbar", 'Zoom'),
+                    'zoom_to_rect', 'zoom'
+                )
+            )
             self.toolitems.append((None, None, None, None))
 
             icon_zoom = QtGui.QIcon()
@@ -104,11 +120,21 @@ class PamhyrPlotToolbar(NavigationToolbar2QT):
 
             icon_btn_isometric_view = QtGui.QIcon()
             icon_btn_isometric_view.addPixmap(
-                QtGui.QPixmap(os.path.abspath(f"{file_path}/../ui/ressources/zoom_fit_11.png")))
+                QtGui.QPixmap(
+                    os.path.abspath(
+                        f"{file_path}/../ui/ressources/zoom_fit_11.png"
+                    )
+                )
+            )
 
             icon_btn_global_view = QtGui.QIcon()
             icon_btn_global_view.addPixmap(
-                QtGui.QPixmap(os.path.abspath(f"{file_path}/../ui/ressources/zoom_fit.png")))
+                QtGui.QPixmap(
+                    os.path.abspath(
+                        f"{file_path}/../ui/ressources/zoom_fit.png"
+                    )
+                )
+            )
 
             icons.append(("isometric_view", icon_btn_isometric_view))
             icons.append(("non_isometric_view", icon_btn_global_view))
diff --git a/src/init.py b/src/init.py
index 9a2305f4..390725c7 100644
--- a/src/init.py
+++ b/src/init.py
@@ -63,13 +63,14 @@ def legal_info():
     def blue(s): return logger.info(
         f"{logger_color_blue()}{s}{logger_color_reset()}")
 
-    blue("""`7MM\"""Mq.   db      `7MMM.     ,MMF'`7MMF'  `7MMF'`YMM'   `MM'`7MM\"""Mq.""")
-    blue("""  MM   `MM. ;MM:       MMMb    dPMM    MM      MM    VMA   ,V    MM   `MM.""")
-    blue("""  MM   ,M9 ,V^MM.      M YM   ,M MM    MM      MM     VMA ,V     MM   ,M9     pd*"*b.""")
-    blue("""  MMmmdM9 ,M  `MM      M  Mb  M' MM    MMmmmmmmMM      VMMP      MMmmdM9     (O)   j8""")
-    blue("""  MM      AbmmmqMA     M  YM.P'  MM    MM      MM       MM       MM  YM.         ,;j9""")
-    blue("""  MM     A'     VML    M  `YM'   MM    MM      MM       MM       MM   `Mb.    ,-='""")
-    blue(""".JMML. .AMA.   .AMMA..JML. `'  .JMML..JMML.  .JMML.   .JMML.   .JMML. .JMM.  Ammmmmmm""")
+    with open(os.path.abspath(
+            os.path.join(
+                os.path.dirname(__file__),
+                "motd.txt"
+            )
+    ), "r") as f:
+        for line in f:
+            blue(line.rstrip())
 
     with open(os.path.abspath(
             os.path.join(
diff --git a/src/motd.txt b/src/motd.txt
new file mode 100644
index 00000000..bfe03bf0
--- /dev/null
+++ b/src/motd.txt
@@ -0,0 +1,7 @@
+`7MM"""Mq.   db      `7MMM.     ,MMF'`7MMF'  `7MMF'`YMM'   `MM'`7MM"""Mq.
+  MM   `MM. ;MM:       MMMb    dPMM    MM      MM    VMA   ,V    MM   `MM.
+  MM   ,M9 ,V^MM.      M YM   ,M MM    MM      MM     VMA ,V     MM   ,M9     pd*"*b.
+  MMmmdM9 ,M  `MM      M  Mb  M' MM    MMmmmmmmMM      VMMP      MMmmdM9     (O)   j8
+  MM      AbmmmqMA     M  YM.P'  MM    MM      MM       MM       MM  YM.         ,;j9
+  MM     A'     VML    M  `YM'   MM    MM      MM       MM       MM   `Mb.    ,-='
+.JMML. .AMA.   .AMMA..JML. `'  .JMML..JMML.  .JMML.   .JMML.   .JMML. .JMM.  Ammmmmmm
-- 
GitLab