Commit efd8960e authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Pamhyr2: Fix pep8.

No related merge requests found
Pipeline #55030 passed with stages
in 3 minutes and 26 seconds
Showing with 26 additions and 19 deletions
+26 -19
...@@ -818,18 +818,18 @@ class GraphWidget(QGraphicsView): ...@@ -818,18 +818,18 @@ class GraphWidget(QGraphicsView):
# If state is "move" # If state is "move"
if self._state == "move": if self._state == "move":
# Move on scene # Move on scene
if (not self.selected_item() and if not self.selected_item():
(event.buttons() & Qt.LeftButton)): if event.buttons() & Qt.LeftButton:
old_p = self.mapToScene( old_p = self.mapToScene(
int(self.m_origin_x), int(self.m_origin_y) int(self.m_origin_x), int(self.m_origin_y)
) )
new_p = self.mapToScene(event.pos()) new_p = self.mapToScene(event.pos())
translation = new_p - old_p translation = new_p - old_p
self.translate(translation.x(), translation.y()) self.translate(translation.x(), translation.y())
self.m_origin_x = event.x() self.m_origin_x = event.x()
self.m_origin_y = event.y() self.m_origin_y = event.y()
# Propagate event # Propagate event
self.update() self.update()
......
...@@ -162,7 +162,10 @@ class SolverLogWindow(PamhyrWindow): ...@@ -162,7 +162,10 @@ class SolverLogWindow(PamhyrWindow):
if ok: if ok:
self.run() self.run()
else: else:
self._log(f" *** Failed to export study to {self._solver._type}", color="red") self._log(
f" *** Failed to export study to {self._solver._type}",
color="red"
)
def setup_action(self): def setup_action(self):
self.find(QAction, "action_start").setEnabled(False) self.find(QAction, "action_start").setEnabled(False)
...@@ -324,7 +327,11 @@ class SolverLogWindow(PamhyrWindow): ...@@ -324,7 +327,11 @@ class SolverLogWindow(PamhyrWindow):
def start(self): def start(self):
if self._solver.is_stoped(): if self._solver.is_stoped():
self._log(f" *** Export study {self._solver.name}", color="blue") self._log(f" *** Export study {self._solver.name}", color="blue")
ok = self._solver.export(self._study, self._workdir, qlog=self._output)
ok = self._solver.export(
self._study, self._workdir, qlog=self._output
)
if not ok: if not ok:
self._log(f" *** Failed to export", color="red") self._log(f" *** Failed to export", color="red")
self.update() self.update()
......
...@@ -70,17 +70,17 @@ class PamhyrPlot(APlot): ...@@ -70,17 +70,17 @@ class PamhyrPlot(APlot):
self._label_x = "X" self._label_x = "X"
self._label_y = "Y" self._label_y = "Y"
self._isometric_axis = True #: Use isometric view self._isometric_axis = True #: Use isometric view
self._auto_relim = True #: Auto relim axes at plot creation self._auto_relim = True #: Auto relim axes at plot creation
self._autoscale = True #: Auto scale at plot creation self._autoscale = True #: Auto scale at plot creation
self._auto_relim_update = False #: Auto relim axes at plot update self._auto_relim_update = False #: Auto relim axes at plot update
self._autoscale_update = False #: Auto scale at plot creation self._autoscale_update = False #: Auto scale at plot creation
self._highlight_data = None #: Data identifier to highlight (free type) self._highlight_data = None #: Data identifier to highlight
self._highlight_data_update = False self._highlight_data_update = False
self._current_data = None #: Current data identifier (free type) self._current_data = None #: Current data identifier
self._current_data_update = False self._current_data_update = False
super(PamhyrPlot, self).__init__(data=data) super(PamhyrPlot, self).__init__(data=data)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment