diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py index c35013a17f..e93c75d0ab 100644 --- a/src/Mod/Arch/ArchAxis.py +++ b/src/Mod/Arch/ArchAxis.py @@ -398,7 +398,7 @@ class _ViewProviderAxis: center = p2.add(Vector(dv).multiply(rad)) normal = vobj.Object.Placement.Rotation.multVec(Vector(0,0,1)) chord = dv.cross(normal) - if arrow == True: + if arrow: p3 = p2.add(Vector(chord).multiply(rad/2).negative()) if vobj.BubblePosition.startswith("Arrow"): p4 = p3.add(Vector(dv).multiply(rad*2).negative()) diff --git a/src/Mod/Arch/ArchBuilding.py b/src/Mod/Arch/ArchBuilding.py index 2d37f63af6..6cd647aea6 100644 --- a/src/Mod/Arch/ArchBuilding.py +++ b/src/Mod/Arch/ArchBuilding.py @@ -231,7 +231,7 @@ class _CommandBuilding: if not Draft.getType(obj) in ["Site", "Building"] : buildingobj.append(obj) else : - if link == True : + if link : buildingobj.append(obj) else: warning = True diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 12303dd84a..66f07f00d3 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -1704,7 +1704,7 @@ class _ToggleSubs: if mode is None: # take the first sub as base mode = sub.ViewObject.isVisible() - if mode == True: + if mode: sub.ViewObject.hide() else: sub.ViewObject.show() diff --git a/src/Mod/Arch/ArchFloor.py b/src/Mod/Arch/ArchFloor.py index 94d85bc962..b80dbaf4e4 100644 --- a/src/Mod/Arch/ArchFloor.py +++ b/src/Mod/Arch/ArchFloor.py @@ -139,7 +139,7 @@ class _CommandFloor: if not Draft.getType(obj) in ["Site", "Building"] : floorobj.append(obj) else : - if link == True : + if link: floorobj.append(obj) else: warning = True diff --git a/src/Mod/Arch/ArchReference.py b/src/Mod/Arch/ArchReference.py index c62321b8c4..91b1903896 100644 --- a/src/Mod/Arch/ArchReference.py +++ b/src/Mod/Arch/ArchReference.py @@ -473,7 +473,7 @@ class ViewProviderArchReference: if vobj.DiffuseColor and vobj.UpdateColors: vobj.DiffuseColor = vobj.DiffuseColor elif prop == "Visibility": - if vobj.Visibility == True: + if vobj.Visibility: if (not vobj.Object.Shape) or vobj.Object.Shape.isNull(): vobj.Object.Proxy.reload = True vobj.Object.Proxy.execute(vobj.Object) diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index b89d90a0bd..e6ad5f530d 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -516,15 +516,15 @@ class _CommandSite: link = p.GetBool("FreeLinking",False) siteobj = [] warning = False - for obj in sel : + for obj in sel: if (Draft.getType(obj) == "Building") or (hasattr(obj,"IfcType") and obj.IfcType == "Building"): siteobj.append(obj) - else : - if link == True : + else: + if link: siteobj.append(obj) else: warning = True - if warning : + if warning: message = translate( "Arch" , "Please either select only Building objects or nothing at all!\n\ Site is not allowed to accept any other object besides Building.\n\ Other objects will be removed from the selection.\n\ @@ -534,7 +534,7 @@ Note: You can change that in the preferences.") message = translate( "Arch" , "There is no valid object in the selection.\n\ Site creation aborted.") + "\n" ArchCommands.printMessage( message ) - else : + else: ss = "[ " for o in siteobj: ss += "FreeCAD.ActiveDocument." + o.Name + ", " diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index d27f7b1fcb..06b1342d3d 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -1379,7 +1379,7 @@ class _StructuralSystem(ArchComponent.Component): # OBSOLETE - All Arch objects if hasattr(obj,"Align"): if obj.Align == False : apl = self.getAxisPlacement(obj) - if obj.Align == True : + if obj.Align: apl = None else : apl = self.getAxisPlacement(obj) @@ -1419,7 +1419,7 @@ class _StructuralSystem(ArchComponent.Component): # OBSOLETE - All Arch objects pts = [] if len(obj.Axes) == 1: if hasattr(obj,"Align"): - if obj.Align == True : + if obj.Align: p0 = obj.Axes[0].Shape.Edges[0].Vertexes[1].Point for e in obj.Axes[0].Shape.Edges: p = e.Vertexes[1].Point diff --git a/src/Mod/Draft/draftfunctions/upgrade.py b/src/Mod/Draft/draftfunctions/upgrade.py index 8543653c01..a26916af1d 100644 --- a/src/Mod/Draft/draftfunctions/upgrade.py +++ b/src/Mod/Draft/draftfunctions/upgrade.py @@ -161,7 +161,7 @@ def upgrade(objects, delete=False, force=None): return None if len(obj.Shape.Edges) == 1: return None - if is_straight_line(obj.Shape) == True: + if is_straight_line(obj.Shape): return None if utils.get_type(obj) == "Wire": obj.Closed = True @@ -507,10 +507,9 @@ def upgrade(objects, delete=False, force=None): elif len(objects) > 1 and len(edges) > 1: result = makeWires(objects) if result: - if result == True: - _msg(translate("draft","Found several wires or edges: wiring them")) - else: - _msg(translate("draft","Found several non-treatable objects: creating compound")) + _msg(translate("draft","Found several wires or edges: wiring them")) + else: + _msg(translate("draft","Found several non-treatable objects: creating compound")) # special case, we have only one open wire. We close it, # unless it has only 1 edge! elif len(objects) == 1 and len(openwires) == 1: diff --git a/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py b/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py index 228872dc47..fd63c5cf6a 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py +++ b/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py @@ -194,7 +194,7 @@ class DraftBSplineGuiTools(DraftWireGuiTools): return pts = obj.Points - if (obj.Closed == True): + if obj.Closed: curve = obj.Shape.Edges[0].Curve else: curve = obj.Shape.Curve @@ -455,7 +455,7 @@ class DraftCircleGuiTools(GuiTools): px = obj.Radius * math.cos(math.radians(angle)) py = obj.Radius * math.sin(math.radians(angle)) p = App.Vector(px, py, 0.0) - if global_placement == True: + if global_placement: p = obj.getGlobalPlacement().multVec(p) return p return None diff --git a/src/Mod/OpenSCAD/OpenSCADCommands.py b/src/Mod/OpenSCAD/OpenSCADCommands.py index 8c33634195..eedc7df637 100644 --- a/src/Mod/OpenSCAD/OpenSCADCommands.py +++ b/src/Mod/OpenSCAD/OpenSCADCommands.py @@ -93,7 +93,7 @@ class ExplodeGroup: import FreeCADGui oo.ViewObject.show() if color and isdefault(oo.ViewObject.DiffuseColor): - if color == True: + if color: oo.ViewObject.DiffuseColor=randomcolor() else: oo.ViewObject.DiffuseColor=color diff --git a/src/Mod/OpenSCAD/importCSG.py b/src/Mod/OpenSCAD/importCSG.py index 3d35ed5b37..991f114e88 100644 --- a/src/Mod/OpenSCAD/importCSG.py +++ b/src/Mod/OpenSCAD/importCSG.py @@ -484,9 +484,9 @@ def p_offset_action(p): # newobj.ViewObject.Proxy = 0 p[0] = [newobj] -def checkObjShape(obj) : +def checkObjShape(obj): if printverbose: print('Check Object Shape') - if obj.Shape.isNull() == True : + if obj.Shape.isNull(): if printverbose: print('Shape is Null - recompute') obj.recompute() diff --git a/src/Mod/PartDesign/Scripts/Gear.py b/src/Mod/PartDesign/Scripts/Gear.py index 508bd6081f..8812757cf1 100644 --- a/src/Mod/PartDesign/Scripts/Gear.py +++ b/src/Mod/PartDesign/Scripts/Gear.py @@ -219,7 +219,7 @@ def compute(): App.ActiveDocument.recompute() - if c1.isChecked()==True: + if c1.isChecked(): gearMesh = App.ActiveDocument.addObject("Mesh::Feature", "Gear3D-mesh") faces = [] diff --git a/src/Mod/Path/PathScripts/PathDressupPathBoundary.py b/src/Mod/Path/PathScripts/PathDressupPathBoundary.py index 01eff7a407..5a45f60965 100644 --- a/src/Mod/Path/PathScripts/PathDressupPathBoundary.py +++ b/src/Mod/Path/PathScripts/PathDressupPathBoundary.py @@ -174,7 +174,7 @@ class PathBoundary: lastExit = None for cmd in self.baseOp.Path.Commands[1:]: if cmd.Name in PathGeom.CmdMoveAll: - if bogusX == True: + if bogusX: bogusX = "X" not in cmd.Parameters if bogusY: bogusY = "Y" not in cmd.Parameters diff --git a/src/Mod/Path/PathScripts/post/heidenhain_post.py b/src/Mod/Path/PathScripts/post/heidenhain_post.py index 9d94d002f5..935c829b16 100644 --- a/src/Mod/Path/PathScripts/post/heidenhain_post.py +++ b/src/Mod/Path/PathScripts/post/heidenhain_post.py @@ -666,9 +666,9 @@ def HEIDEN_Line( H_Line += " " + H_Line_Params[1][0] # F parameter (check rapid o feed) - if line_rapid == True: + if line_rapid: H_Line_Params[1][1] = FEED_MAX_SPEED - if MACHINE_USE_FMAX == True and line_rapid == True: + if MACHINE_USE_FMAX and line_rapid: H_Line += " FMAX" else: if ( @@ -837,9 +837,9 @@ def HEIDEN_Arc( H_ArcPoint += " " + H_Arc_Params[1][0] # F parameter - if arc_rapid == True: + if arc_rapid: H_Arc_Params[1][1] = FEED_MAX_SPEED - if MACHINE_USE_FMAX == True and arc_rapid == True: + if MACHINE_USE_FMAX and arc_rapid: H_ArcPoint += " FMAX" else: if ( diff --git a/src/Mod/Path/PathScripts/post/philips_post.py b/src/Mod/Path/PathScripts/post/philips_post.py index edc2d82c67..74bc2612e0 100644 --- a/src/Mod/Path/PathScripts/post/philips_post.py +++ b/src/Mod/Path/PathScripts/post/philips_post.py @@ -431,7 +431,7 @@ def export(objectslist, filename, argstring): if not MODAL or command != lastcommand: outstring.append(mappedCommand) - # if MODAL == True: + # if MODAL: # #\better: append iff MODAL == False # if command == lastcommand: # outstring.pop(0) diff --git a/src/Mod/Test/Menu.py b/src/Mod/Test/Menu.py index 0933902dd6..5beb9f939a 100644 --- a/src/Mod/Test/Menu.py +++ b/src/Mod/Test/Menu.py @@ -56,10 +56,10 @@ class MenuCreateCases(unittest.TestCase): self.b = False for i in list: if i == 'TestMenu': self.b=True - self.failUnless(self.b==True,"Test menu not found") + self.failUnless(self.b,"Test menu not found") def tearDown(self): - if self.b == True: + if self.b: FreeCAD.Console.PrintLog ('Test menu successfully added\n') else: FreeCAD.Console.PrintLog ('Adding Test menu failed\n') @@ -84,7 +84,7 @@ class MenuDeleteCases(unittest.TestCase): self.failUnless(self.b==True,"Test menu still added") def tearDown(self): - if self.b == True: + if self.b: FreeCAD.Console.PrintLog ('Test menu successfully removed\n') else: FreeCAD.Console.PrintLog ('Removing Test menu failed\n')