Blanket black formatting for Path python files

This commit is contained in:
Markus Lampert
2022-03-19 13:55:48 -07:00
committed by mlampert
parent 75e5dc95d5
commit 115fbd68bb
12 changed files with 23 additions and 14 deletions

View File

@@ -275,7 +275,10 @@ class PathWorkbench(Workbench):
msgbox = QtGui.QMessageBox(QtGui.QMessageBox.Warning, header, msg)
msgbox.addButton(translate("Path", "Ok"), QtGui.QMessageBox.AcceptRole)
msgbox.addButton(translate("Path", "Don't Show This Anymore"), QtGui.QMessageBox.ActionRole)
msgbox.addButton(
translate("Path", "Don't Show This Anymore"),
QtGui.QMessageBox.ActionRole,
)
if msgbox.exec_() == 1:
preferences().SetBool("WarningSuppressVelocity", True)

View File

@@ -516,7 +516,10 @@ class CommandPathArray:
}
def IsActive(self):
selections = [sel.isDerivedFrom("Path::Feature") for sel in FreeCADGui.Selection.getSelection()]
selections = [
sel.isDerivedFrom("Path::Feature")
for sel in FreeCADGui.Selection.getSelection()
]
return selections and all(selections)
def Activated(self):

View File

@@ -106,7 +106,7 @@ def updateInputField(obj, prop, widget, onBeforeChange=None):
return False
class QuantitySpinBox (QtCore.QObject):
class QuantitySpinBox(QtCore.QObject):
"""Controller class to interface a Gui::QuantitySpinBox.
The spin box gets bound to a given property and supports update in both directions.
QuatitySpinBox(widget, obj, prop, onBeforeChange=None)

View File

@@ -1103,7 +1103,10 @@ class TaskPanel:
else:
r = v.cross(normal) # rotation axis
a = DraftVecUtils.angle(normal, v, r) * 180 / math.pi
PathLog.debug("oh boy: (%.2f, %.2f, %.2f) x (%.2f, %.2f, %.2f) -> (%.2f, %.2f, %.2f) -> %.2f" % (v.x, v.y, v.z, normal.x, normal.y, normal.z, r.x, r.y, r.z, a))
PathLog.debug(
"oh boy: (%.2f, %.2f, %.2f) x (%.2f, %.2f, %.2f) -> (%.2f, %.2f, %.2f) -> %.2f"
% (v.x, v.y, v.z, normal.x, normal.y, normal.z, r.x, r.y, r.z, a)
)
Draft.rotate(sel.Object, a, axis=r)
selObject = None

View File

@@ -219,8 +219,8 @@ class TaskPanelPage(object):
return hasattr(self.form, "toolController")
def setParent(self, parent):
'''setParent() ... used to transfer parent object link to child class.
Do not overwrite.'''
"""setParent() ... used to transfer parent object link to child class.
Do not overwrite."""
self.parent = parent
def onDirtyChanged(self, callback):

View File

@@ -544,7 +544,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
avgCom
) # effectively treats avgCom as origin for each face.
mag = math.sqrt(
adjCom.x ** 2 + adjCom.y ** 2
adjCom.x**2 + adjCom.y**2
) # adjCom.Length without Z values
drctn = 0.0
# Determine direction of vector

View File

@@ -46,6 +46,7 @@ PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)
translate = FreeCAD.Qt.translate
class _TempObject:
Path = None
Name = "Fixture"

View File

@@ -30,6 +30,7 @@ if False:
else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
class AdvancedPreferencesPage:
def __init__(self, parent=None):
self.form = FreeCADGui.PySideUic.loadUi(":preferences/Advanced.ui")
@@ -63,9 +64,7 @@ class AdvancedPreferencesPage:
self.form.WarningSuppressOpenCamLib.setChecked(
PathPreferences.suppressOpenCamLibWarning()
)
self.form.WarningSuppressVelocity.setChecked(
PathPreferences.suppressVelocity()
)
self.form.WarningSuppressVelocity.setChecked(PathPreferences.suppressVelocity())
self.updateSelection()
def updateSelection(self, state=None):

View File

@@ -424,7 +424,7 @@ def CreateCylinder(job, radius=None, height=None, placement=None):
obj.Height = height
elif base:
bb = shapeBoundBox(base.Group)
obj.Radius = math.sqrt(bb.XLength ** 2 + bb.YLength ** 2) / 2.0
obj.Radius = math.sqrt(bb.XLength**2 + bb.YLength**2) / 2.0
obj.Height = max(bb.ZLength, 1)
if placement:

View File

@@ -2097,7 +2097,7 @@ class ObjectSurface(PathOp.ObjectOp):
hlim = bb.XMax
# Compute max radius of stock, as it rotates, and rotational clearance & safe heights
self.bbRadius = math.sqrt(hlim ** 2 + vlim ** 2)
self.bbRadius = math.sqrt(hlim**2 + vlim**2)
self.clearHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value
self.safeHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value

View File

@@ -806,7 +806,7 @@ def RtoIJ(startpoint, command):
perp = chord.cross(Vector(0, 0, 1))
# use pythagoras to get the perp length
plength = math.sqrt(radius ** 2 - (chord.Length / 2) ** 2)
plength = math.sqrt(radius**2 - (chord.Length / 2) ** 2)
perp.normalize()
perp.scale(plength, plength, plength)

View File

@@ -475,7 +475,7 @@ def export(objectslist, filename, argstring):
i = c.Parameters["I"]
# calculate the radius r
j = c.Parameters["J"]
r = math.sqrt(i ** 2 + j ** 2)
r = math.sqrt(i**2 + j**2)
if USE_RADIUS_IF_POSSIBLE and angleUnder180(
command,
lastX,