From 318f6e99659fc4c86e03492c9c9e6b3c75b1bea4 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Mon, 22 Jan 2024 16:04:32 +0100 Subject: [PATCH] Geometry: Fix pep8. --- src/View/Geometry/Window.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index 99fe2c37..0569b9ce 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -540,7 +540,7 @@ class GeometryWindow(PamhyrWindow): QSettings.UserScope, 'MyOrg' ) - if self._study.filename != "" or self._study.filename != None: + if self._study.filename != "" or self._study.filename is not None: default_directory = os.path.basename(self._study.filename) current_dir = settings.value( 'current_directory', @@ -575,22 +575,22 @@ class GeometryWindow(PamhyrWindow): pid += 1 def _export_to_file_st_profile(self, wfile, profile, pid): - num = f"{pid:>6}" - c1 = f"{profile.code1:>6}" - c2 = f"{profile.code2:>6}" - t = f"{len(profile.points):>6}" - kp = f"{profile.kp:>12f}"[0:12] - pname = profile.name - if profile.name == "": - pname = f"p{profile.id:>3}".replace(" ", "0") - name = f"{pname:<19}" - - wfile.write(f"{num}{c1}{c2}{t} {kp} {pname}\n") - - for point in profile.points: - self._export_to_file_st_point(wfile, point) - - wfile.write(f" 999.9990 999.9990 999.9990\n") + num = f"{pid:>6}" + c1 = f"{profile.code1:>6}" + c2 = f"{profile.code2:>6}" + t = f"{len(profile.points):>6}" + kp = f"{profile.kp:>12f}"[0:12] + pname = profile.name + if profile.name == "": + pname = f"p{profile.id:>3}".replace(" ", "0") + name = f"{pname:<19}" + + wfile.write(f"{num}{c1}{c2}{t} {kp} {pname}\n") + + for point in profile.points: + self._export_to_file_st_point(wfile, point) + + wfile.write(f" 999.9990 999.9990 999.9990\n") def _export_to_file_st_point(self, wfile, point): x = f"{point.x:<12.4f}"[0:12] -- GitLab