From fdc2086d111ac792f2b86cbd8d44c0fa1e4237e6 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Mon, 1 Jan 2018 21:03:43 +0100 Subject: [PATCH] FEM: code formating, Python flake8: W503 --- src/Mod/Fem/FemUtils.py | 4 ++-- src/Mod/Fem/PyGui/_TaskPanelFemSolverControl.py | 4 ++-- src/Mod/Fem/femsolver/elmer/sifio.py | 12 ++++++------ src/Mod/Fem/femsolver/run.py | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Mod/Fem/FemUtils.py b/src/Mod/Fem/FemUtils.py index af2715908c..3177f9907b 100644 --- a/src/Mod/Fem/FemUtils.py +++ b/src/Mod/Fem/FemUtils.py @@ -80,7 +80,7 @@ def isOfType(obj, t): def isDerivedFrom(obj, t): - if (hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type") - and obj.Proxy.Type == t): + if (hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type") and + obj.Proxy.Type == t): return True return obj.isDerivedFrom(t) diff --git a/src/Mod/Fem/PyGui/_TaskPanelFemSolverControl.py b/src/Mod/Fem/PyGui/_TaskPanelFemSolverControl.py index 490a0a394f..7d8e6b446a 100644 --- a/src/Mod/Fem/PyGui/_TaskPanelFemSolverControl.py +++ b/src/Mod/Fem/PyGui/_TaskPanelFemSolverControl.py @@ -332,5 +332,5 @@ class ControlWidget(QtGui.QWidget): self._directoryGrp.setDisabled(False) self._writeBtt.setDisabled(False) self._editBtt.setDisabled( - not machine.solver.Proxy.editSupported() - or machine.state < femsolver.run.PREPARE) + not machine.solver.Proxy.editSupported() or + machine.state < femsolver.run.PREPARE) diff --git a/src/Mod/Fem/femsolver/elmer/sifio.py b/src/Mod/Fem/femsolver/elmer/sifio.py index 99e1e52388..bd2ae98b39 100644 --- a/src/Mod/Fem/femsolver/elmer/sifio.py +++ b/src/Mod/Fem/femsolver/elmer/sifio.py @@ -178,11 +178,11 @@ class Builder(object): for solverSection in eqSection[self._ACTIVE_SOLVERS]: if solverSection not in allSections: allSections.append(solverSection) - if (BODY_FORCE in section - and section[BODY_FORCE] not in allSections): + if (BODY_FORCE in section and + section[BODY_FORCE] not in allSections): allSections.append(section[BODY_FORCE]) - if (INITIAL_CONDITION in section - and section[INITIAL_CONDITION] not in allSections): + if (INITIAL_CONDITION in section and + section[INITIAL_CONDITION] not in allSections): allSections.append(section[INITIAL_CONDITION]) for name, section in self._boundaries.items(): section["Name"] = name @@ -331,8 +331,8 @@ class _Writer(object): return it.next() def _isCollection(self, data): - return (not isinstance(data, str) - and isinstance(data, collections.Iterable)) + return (not isinstance(data, str) and + isinstance(data, collections.Iterable)) def _checkScalar(self, dataType): if issubclass(dataType, int): diff --git a/src/Mod/Fem/femsolver/run.py b/src/Mod/Fem/femsolver/run.py index 31dafa9bc4..e595244e21 100644 --- a/src/Mod/Fem/femsolver/run.py +++ b/src/Mod/Fem/femsolver/run.py @@ -187,8 +187,8 @@ class Machine(BaseTask): self._confTasks() self._isReset = False self._pendingState = self.state - while (not self.aborted and not self.failed - and self._pendingState <= self.target): + while (not self.aborted and not self.failed and + self._pendingState <= self.target): task = self._getTask(self._pendingState) self._runTask(task) self.report.extend(task.report) @@ -368,8 +368,8 @@ class _DocObserver(object): def _checkEquation(self, obj): for o in obj.Document.Objects: - if (FemUtils.isDerivedFrom(o, "Fem::FemSolverObject") - and hasattr(o, "Group") and obj in o.Group): + if (FemUtils.isDerivedFrom(o, "Fem::FemSolverObject") and + hasattr(o, "Group") and obj in o.Group): if o in _machines: _machines[o].reset()