From e97b6c4510217af4cf4378a7af7e40488ab0bf45 Mon Sep 17 00:00:00 2001 From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch> Date: Mon, 17 Jun 2019 17:04:44 +0200 Subject: [PATCH] flake8 fixes --- examples/demo.py | 8 +------- flatland/utils/editor.py | 1 - flatland/utils/graphics_pil.py | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/demo.py b/examples/demo.py index 1e4a14d3..fa897713 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -164,13 +164,7 @@ class Demo: demo_001 = Demo(Scenario_Generator.load_scenario('complex_scene.pkl')) demo_001.set_record_frames(os.path.join(__file_dirname__, '..', 'rendering', 'frame_{:04d}.bmp')) demo_001.run_demo(120) - - @staticmethod - def run_complex_scene_2(): - demo_001 = Demo(Scenario_Generator.load_scenario('complex_scene_2.pkl')) - demo_001.set_record_frames(os.path.join(__file_dirname__, '..', 'rendering', 'frame_{:04d}.bmp')) - demo_001.run_demo(120) + if __name__ == "__main__": Demo.run_complex_scene() - Demo.run_complex_scene_2() diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index 25e11a4d..081cf02c 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -328,7 +328,6 @@ class Controller(object): else: self.model.mod_path(not event["shiftKey"]) - def refresh(self, event): self.debug("refresh") self.view.redraw() diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index e3e32125..23f8b879 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -439,7 +439,7 @@ class PILSVG(PILGL): elif (self.background_grid[col][row] > 4) or ((col ** 3 + row ** 2 + col * row) % 10 == 0): a = int(self.background_grid[col][row]) - 4 a = (a + (col + row + col * row + col ** 3 + row ** 4)) % len(self.dScenery) - if (col + row + col * row ) % 10 > 2: + if (col + row + col * row) % 10 > 2: a = 0 pilTrack = self.dScenery[a] -- GitLab