mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
more pep8
This commit is contained in:
1 parent
3b8a49d429
commit
a317cd849f
38 files changed
+241
-125
No files matched your search
@@ -25,7 +25,8 @@ from PyQt5.QtWidgets import (
|
||||
QMessageBox, QUndoCommand, QUndoStack,
|
||||
)
|
||||
|
||||
from Model.BoundaryConditionsAdisTS.BoundaryConditionAdisTS import BoundaryConditionAdisTS
|
||||
from Model.BoundaryConditionsAdisTS.BoundaryConditionAdisTS \
|
||||
import BoundaryConditionAdisTS
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
@@ -43,15 +44,24 @@ class SetDataCommand(QUndoCommand):
|
||||
|
||||
def undo(self):
|
||||
if self._column == 0:
|
||||
self._data._data[self._index] = (self._old,self._data._data[self._index][1])
|
||||
self._data._data[self._index] = (
|
||||
self._old, self._data._data[self._index][1]
|
||||
)
|
||||
else:
|
||||
self._data._data[self._index] = (self._data._data[self._index][0], self._old)
|
||||
self._data._data[self._index] = (
|
||||
self._data._data[self._index][0], self._old
|
||||
)
|
||||
|
||||
def redo(self):
|
||||
if self._column == 0:
|
||||
self._data._data[self._index] = (self._new,self._data._data[self._index][1])
|
||||
self._data._data[self._index] = (
|
||||
self._new, self._data._data[self._index][1]
|
||||
)
|
||||
else:
|
||||
self._data._data[self._index] = (self._data._data[self._index][0], self._new)
|
||||
self._data._data[self._index] = (
|
||||
self._data._data[self._index][0], self._new
|
||||
)
|
||||
|
||||
|
||||
class AddCommand(QUndoCommand):
|
||||
def __init__(self, data, index):
|
||||
@@ -66,10 +76,13 @@ class AddCommand(QUndoCommand):
|
||||
|
||||
def redo(self):
|
||||
if self._new is None:
|
||||
self._new = self._data._data.insert(self._index, (self._data._types[0](0), self._data._types[1](0.0)))
|
||||
self._new = self._data._data.insert(self._index, (
|
||||
self._data._types[0](0), self._data._types[1](0.0)
|
||||
))
|
||||
else:
|
||||
self._data._data.insert(self._index, self._new)
|
||||
|
||||
|
||||
class DelCommand(QUndoCommand):
|
||||
def __init__(self, data, rows):
|
||||
QUndoCommand.__init__(self)
|
||||
@@ -89,7 +102,3 @@ class DelCommand(QUndoCommand):
|
||||
def redo(self):
|
||||
for row in self._rows:
|
||||
del self._data._data[row]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user