From 86baf505a09d6c563a136372b5129ffd46632d79 Mon Sep 17 00:00:00 2001 From: luzpaz Date: Mon, 1 Sep 2025 00:22:39 -0400 Subject: [PATCH] BIM: fix trailing whitespace and refine source comment grammar (#23496) * BIM: fix trailing whitespace and refine source comment grammar * BIM: remove unnecessary newline --- src/Mod/BIM/ArchWindow.py | 1 - src/Mod/BIM/bimcommands/BimWindow.py | 8 ++++---- src/Mod/BIM/bimtests/TestArchBuildingPart.py | 3 +-- src/Mod/BIM/bimtests/TestWebGLExport.py | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Mod/BIM/ArchWindow.py b/src/Mod/BIM/ArchWindow.py index 125cca5c56..6f30f0567c 100644 --- a/src/Mod/BIM/ArchWindow.py +++ b/src/Mod/BIM/ArchWindow.py @@ -232,7 +232,6 @@ class _Window(ArchComponent.Component): if prop == "Sill": self.setSillProperties(obj) # Can't wait until onDocumentRestored self.onSillChanged(obj) - elif not "Restore" in obj.State: if prop in ["Base","WindowParts","Placement","HoleDepth","Height","Width","Hosts","Shape"]: # anti-recursive loops, bc the base sketch will touch the Placement all the time diff --git a/src/Mod/BIM/bimcommands/BimWindow.py b/src/Mod/BIM/bimcommands/BimWindow.py index 62b3dd829c..bea5600287 100644 --- a/src/Mod/BIM/bimcommands/BimWindow.py +++ b/src/Mod/BIM/bimcommands/BimWindow.py @@ -213,7 +213,7 @@ class Arch_Window: # Historically, this normal was deduced by the orientation of the Base Sketch and hardcoded in the Normal property. # Now with the new AutoNormalReversed property/flag, set True as default, the auto Normal previously in opposite direction to is now consistent with that previously hardcoded. # With the normal set to 'auto', window object would not suffer weird shape if the Base Sketch is rotated by some reason. - # Keep the property be 'auto' (0,0,0) here. + # Keep the property be 'auto' (0,0,0) here. #FreeCADGui.doCommand("win.Normal = pl.Rotation.multVec(FreeCAD.Vector(0, 0, -1))") FreeCADGui.doCommand("win.Width = " + str(self.Width)) FreeCADGui.doCommand("win.Height = " + str(self.Height)) @@ -234,13 +234,13 @@ class Arch_Window: import ArchSketchObject if (host and Draft.getType(host.Base) == "ArchSketch" and - hasattr(ArchSketchObject, 'attachToHost') and - hasattr(FreeCAD, 'ArchSketchLock') and + hasattr(ArchSketchObject, 'attachToHost') and + hasattr(FreeCAD, 'ArchSketchLock') and FreeCAD.ArchSketchLock): if self.Include: # Window base sketch's placement stay at origin is good if addon exists and self.Include # Window object triggers onChanged() upon setting/changing Window.Sill to move Window's z position - # For Window with SketchArch add-on, attachToHost() is to be run below below to set the 'initial' Window's placement first before triggering onChanged() below, + # For Window with SketchArch add-on, attachToHost() is to be run below to set the 'initial' Window's placement prior to triggering onChanged() below, # so window_sill parameter is not used here at the moment, see 'if self.Include' below. #FreeCADGui.doCommand("win = Arch.makeWindowPreset('" + WindowPresets[self.Preset] + "' " + wp + ", window_sill=" + str(self.Sill.Value) + ")") FreeCADGui.doCommand("win = Arch.makeWindowPreset('" + WindowPresets[self.Preset] + "' " + wp + ")") diff --git a/src/Mod/BIM/bimtests/TestArchBuildingPart.py b/src/Mod/BIM/bimtests/TestArchBuildingPart.py index 9060ce1a4c..6fb9f82c26 100644 --- a/src/Mod/BIM/bimtests/TestArchBuildingPart.py +++ b/src/Mod/BIM/bimtests/TestArchBuildingPart.py @@ -89,7 +89,7 @@ class TestArchBuildingPart(TestArchBase.TestArchBase): building = Arch.makeBuilding(name="TestBuilding") self.assertIsNotNone(building, "makeBuilding failed to create a building object.") self.assertEqual(building.Label, "TestBuilding", "Building label is incorrect.") - + def test_convertFloors(self): """Test the convertFloors function.""" operation = "Testing convertFloors..." @@ -108,4 +108,3 @@ class TestArchBuildingPart(TestArchBase.TestArchBase): obj = Arch.make2DDrawing() self.assertIsNotNone(obj, "make2DDrawing failed to create an object") self.assertEqual(obj.Label, "Drawing", "Incorrect default label for 2D Drawing") - \ No newline at end of file diff --git a/src/Mod/BIM/bimtests/TestWebGLExport.py b/src/Mod/BIM/bimtests/TestWebGLExport.py index b2b01730fb..29c6a3c135 100644 --- a/src/Mod/BIM/bimtests/TestWebGLExport.py +++ b/src/Mod/BIM/bimtests/TestWebGLExport.py @@ -41,7 +41,7 @@ class TestWebGLExport(TestArchBase): def setUp(self): """Using TestArchBase setUp to initialize the document for convenience, but also create a temporary directory for tests.""" - super().setUp() + super().setUp() self.test_dir = tempfile.mkdtemp() self.test_template_content = """