BIM: Trim trailing newlines

This commit is contained in:
luzpaz
2024-07-13 15:42:03 +00:00
committed by wwmayer
parent a4862b6819
commit 25e8aacbe3
20 changed files with 36 additions and 36 deletions

View File

@@ -300,7 +300,7 @@ class BuildingPart(ArchIFC.IfcProduct):
def execute(self,obj):
"gather all the child shapes into a compound"
pl = obj.Placement
shapes,materialstable = self.getShapes(obj)
if shapes:
@@ -323,7 +323,7 @@ class BuildingPart(ArchIFC.IfcProduct):
obj.ViewObject.Proxy.onChanged(obj.ViewObject,"AutoGroupBox")
def getMovableChildren(self, obj):
"recursively get movable children"
result = []

View File

@@ -744,10 +744,10 @@ class _Roof(ArchComponent.Component):
# Not only the solid of the base object itself be subtracted from
# a Wall, but all portion of the wall above the roof solid would be
# subtracted as well.
#
#
# FC forum discussion : Sketch based Arch_Roof and wall substraction
# - https://forum.freecad.org/viewtopic.php?t=84389
#
#
faces = []
solids = []
for f in obj.Base.Shape.Faces: # obj.Base.Shape.Solids.Faces

View File

@@ -219,7 +219,7 @@ class _Space(ArchComponent.Component):
if not "Boundaries" in pl:
obj.addProperty("App::PropertyLinkSubList","Boundaries", "Space",QT_TRANSLATE_NOOP("App::Property","The objects that make the boundaries of this space object"))
if not "Area" in pl:
obj.addProperty("App::PropertyArea", "Area", "Space",QT_TRANSLATE_NOOP("App::Property","Identical to Horizontal Area"))
obj.addProperty("App::PropertyArea", "Area", "Space",QT_TRANSLATE_NOOP("App::Property","Identical to Horizontal Area"))
if not "FinishFloor" in pl:
obj.addProperty("App::PropertyString", "FinishFloor", "Space",QT_TRANSLATE_NOOP("App::Property","The finishing of the floor of this space"))
if not "FinishWalls" in pl:
@@ -245,7 +245,7 @@ class _Space(ArchComponent.Component):
obj.addProperty("App::PropertyEnumeration","Conditioning", "Space",QT_TRANSLATE_NOOP("App::Property","The type of air conditioning of this space"))
obj.Conditioning = ConditioningTypes
if not "Internal" in pl:
obj.addProperty("App::PropertyBool", "Internal", "Space",QT_TRANSLATE_NOOP("App::Property","Specifies if this space is internal or external"))
obj.addProperty("App::PropertyBool", "Internal", "Space",QT_TRANSLATE_NOOP("App::Property","Specifies if this space is internal or external"))
obj.Internal = True
if not "AreaCalculationType" in pl:
obj.addProperty("App::PropertyEnumeration", "AreaCalculationType", "Space",QT_TRANSLATE_NOOP("App::Property","Defines the calculation type for the horizontal area and its perimeter length"))

View File

@@ -13,4 +13,4 @@ for subdir in ["icons", "ui", "translations"]:
txt += " </qresource>\n</RCC>\n"
with open(os.path.join(cdir, "Arch.qrc"), "w") as resfile:
resfile.write(txt)

View File

@@ -72,7 +72,7 @@ class Arch_Add:
class Arch_Remove:
"the Arch Add command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_Remove',
'MenuText': QT_TRANSLATE_NOOP("Arch_Remove","Remove component"),
@@ -110,7 +110,7 @@ class Arch_Remove:
class Arch_SplitMesh:
"the Arch SplitMesh command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_SplitMesh',
'MenuText': QT_TRANSLATE_NOOP("Arch_SplitMesh","Split Mesh"),
@@ -138,7 +138,7 @@ class Arch_SplitMesh:
class Arch_MeshToShape:
"the Arch MeshToShape command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_MeshToShape',
'MenuText': QT_TRANSLATE_NOOP("Arch_MeshToShape","Mesh to Shape"),
@@ -302,7 +302,7 @@ class Arch_ToggleIfcBrepFlag:
class Arch_Component:
"the Arch Component command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_Component',
'MenuText': QT_TRANSLATE_NOOP("Arch_Component","Component"),
@@ -329,7 +329,7 @@ class Arch_Component:
class Arch_CloneComponent:
"the Arch Clone Component command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_Component_Clone',
'MenuText': QT_TRANSLATE_NOOP("Arch_CloneComponent","Clone component"),
@@ -356,7 +356,7 @@ class Arch_CloneComponent:
class Arch_IfcSpreadsheet:
"the Arch Schedule command definition"
def GetResources(self):
return {'Pixmap': 'Arch_Schedule',
'MenuText': QT_TRANSLATE_NOOP("Arch_IfcSpreadsheet","Create IFC spreadsheet..."),
@@ -383,7 +383,7 @@ class Arch_IfcSpreadsheet:
class Arch_ToggleSubs:
"the ToggleSubs command definition"
def GetResources(self):
return {'Pixmap' : 'Arch_ToggleSubs',
'Accel' : 'Ctrl+Space',

View File

@@ -32,7 +32,7 @@ QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP
class BIM_Beam(ArchStructure._CommandStructure):
def __init__(self):
super().__init__()
self.beammode = True

View File

@@ -629,10 +629,10 @@ class BIM_Classification:
def getIcon(self,obj):
"""returns a QIcon for an object"""
from PySide import QtCore, QtGui
import Arch_rc
if hasattr(obj.ViewObject, "Icon"):
return obj.ViewObject.Icon
elif hasattr(obj.ViewObject, "Proxy") and hasattr(obj.ViewObject.Proxy, "getIcon"):

View File

@@ -91,7 +91,7 @@ class Arch_Equipment:
class Arch_3Views:
# OBSOLETE
"the Arch 3Views command definition"

View File

@@ -108,7 +108,7 @@ class Arch_PipeConnector:
FreeCADGui.doCommand("Draft.autogroup(obj)")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
class Arch_PipeGroupCommand:

View File

@@ -37,7 +37,7 @@ class BIM_Project:
return {
"Pixmap": "BIM_Project",
"MenuText": QT_TRANSLATE_NOOP("BIM_Project", "Project"),
"ToolTip": QT_TRANSLATE_NOOP("BIM_Project",
"ToolTip": QT_TRANSLATE_NOOP("BIM_Project",
"Create an empty NativeIFC project"),
}

View File

@@ -94,6 +94,6 @@ class Arch_Rebar:
FreeCADGui.Control.showDialog(ArchComponent.SelectionTaskPanel())
FreeCAD.ArchObserver = ArchComponent.ArchSelectionObserver(nextCommand="Arch_Rebar")
FreeCADGui.Selection.addObserver(FreeCAD.ArchObserver)
FreeCADGui.addCommand('Arch_Rebar',Arch_Rebar())

View File

@@ -62,7 +62,7 @@ class Arch_SectionPlane:
FreeCADGui.doCommand("section = Arch.makeSectionPlane("+ss+")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
FreeCADGui.addCommand('Arch_SectionPlane', Arch_SectionPlane())

View File

@@ -71,7 +71,7 @@ class BIM_TogglePanels:
if togglebutton:
togglebutton.setChecked(False)
else:
widgets = PARAMS.GetString("HiddenWidgets",
widgets = PARAMS.GetString("HiddenWidgets",
"Python console;;Report view;;Selection view;;"
)
widgets = [mw.findChild(QtGui.QWidget, w) for w in widgets.split(";;") if w]

View File

@@ -79,7 +79,7 @@ class Arch_Truss:
self.createTruss()
def createTruss(self, basename=""):
"""Creates the truss"""
FreeCADGui.Control.closeDialog()
@@ -96,6 +96,6 @@ class Arch_Truss:
FreeCADGui.doCommand("Draft.autogroup(obj)")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
FreeCADGui.addCommand('Arch_Truss', Arch_Truss())

View File

@@ -76,7 +76,7 @@ class BIM_Views:
self.dialog = FreeCADGui.PySideUic.loadUi(":/ui/dialogViews.ui")
vm.setWidget(self.dialog)
vm.tree = self.dialog.tree
# set context menu
self.dialog.tree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
@@ -252,7 +252,7 @@ class BIM_Views:
sortLvItems = [item[0] for item in sortLvHold]
treeViewItems = treeViewItems + sortLvItems + soloProxyHold
vm.tree.addTopLevelItems(treeViewItems)
# add views
ficon = QtGui.QIcon.fromTheme("folder", QtGui.QIcon(":/icons/folder.svg"))
views = self.getViews()
@@ -445,10 +445,10 @@ class BIM_Views:
if getattr(v, "Source", None):
views.append(v.Source)
return views
def getPages(self):
"""Returns a list of TD pages"""
return [o for o in FreeCAD.ActiveDocument.Objects if o.isDerivedFrom('TechDraw::DrawPage')]
return [o for o in FreeCAD.ActiveDocument.Objects if o.isDerivedFrom('TechDraw::DrawPage')]
# These functions need to be localized outside the command class, as they are used outside this module

View File

@@ -164,8 +164,8 @@ class IFC_UpdateIOS:
# code from https://www.geeksforgeeks.org/compare-two-version-numbers
arr1 = v1.replace("v","").split(".")
arr2 = v2.replace("v","").split(".")
arr1 = v1.replace("v","").split(".")
arr2 = v2.replace("v","").split(".")
n = len(arr1)
m = len(arr2)
arr1 = [int(i) for i in arr1]

View File

@@ -54,7 +54,7 @@ SDU = int(SINGLEDOC) # number of objects is different in singledoc
"""
unit tests for the NativeIFC functionality. To run the tests, either:
- in terminal mode: FreeCAD -t ifc_selftest
- in the FreeCAD UI: Switch to Test Framework workbench, press "Self test" and
- in the FreeCAD UI: Switch to Test Framework workbench, press "Self test" and
choose ifc_selftest in the list
"""

View File

@@ -20,7 +20,7 @@
# * *
# ***************************************************************************
"""This script converts a xml file containing pset definitions to a csv file.
"""This script converts a xml file containing pset definitions to a csv file.
Python3 only!! (py2 csv doesn't support utf8"""
import xml.sax, os