Skip to content

Commit

Permalink
Arch: Fix header uniformity and remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
luzpaz authored and wwmayer committed Nov 16, 2020
1 parent 42ccdb8 commit 67381e9
Show file tree
Hide file tree
Showing 45 changed files with 211 additions and 225 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Arch/Arch.py
Expand Up @@ -19,9 +19,9 @@
#* *
#***************************************************************************

__title__= "FreeCAD Arch API"
__title__ = "FreeCAD Arch API"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

## \defgroup ARCH Arch
# \ingroup PYTHONWORKBENCHES
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchAxis.py
Expand Up @@ -37,9 +37,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
return txt
# \endcond

__title__="FreeCAD Axis System"
__title__ = "FreeCAD Axis System"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

## @package ArchAxis
# \ingroup ARCH
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Arch/ArchBuilding.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -35,9 +34,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
return txt
# \endcond

__title__="FreeCAD Building"
__title__ = "FreeCAD Building"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

## @package ArchBuilding
# \ingroup ARCH
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Arch/ArchBuildingPart.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2018 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -51,9 +50,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
# This module provides tools to build BuildingPart objects.
# BuildingParts are used to group different Arch objects

__title__="FreeCAD Arch BuildingPart"
__title__ = "FreeCAD Arch BuildingPart"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"


BuildingTypes = ['Undefined',
Expand Down
11 changes: 5 additions & 6 deletions src/Mod/Arch/ArchCommands.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -35,13 +34,13 @@ def translate(ctxt,txt):
return txt
# \endcond

__title__="FreeCAD Arch Commands"
__title__ = "FreeCAD Arch Commands"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

## @package ArchCommands
# \ingroup ARCH
# \brief Utility functions for theArch Workbench
# \brief Utility functions for the Arch Workbench
#
# This module provides general functions used by Arch tools
# and utility commands
Expand All @@ -64,7 +63,7 @@ def string_replace(text, pattern, replacement):
if sys.version_info.major < 3:
text = text.encode("utf8")
return text.replace(pattern, replacement)


def getStringList(objects):
'''getStringList(objects): returns a string defining a list
Expand Down Expand Up @@ -1201,7 +1200,7 @@ def cleanArchSplitter(objects=None):


def rebuildArchShape(objects=None):
"""rebuildArchShape([objects]): takes the faces from the base shape of the given (or selected
"""rebuildArchShape([objects]): takes the faces from the base shape of the given (or selected
if objects is None) Arch objects, and tries to rebuild a valid solid from them."""
import FreeCAD,FreeCADGui,Part
if not objects:
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -27,9 +27,9 @@
TODO put examples here.
"""

__title__="FreeCAD Arch Component"
__title__ = "FreeCAD Arch Component"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

import FreeCAD,Draft,ArchCommands,math,sys,json,os,ArchIFC,ArchIFCSchema
from FreeCAD import Vector
Expand Down Expand Up @@ -779,7 +779,7 @@ def processSubShapes(self,obj,base,placement=None):
subvolume = o.Subvolume.Shape.copy()
if hasattr(o,"Placement"):
subvolume.Placement = subvolume.Placement.multiply(o.Placement)

if subvolume:
if base.Solids and subvolume.Solids:
if placement:
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Arch/ArchCurtainWall.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand All @@ -21,9 +20,9 @@
#* *
#***************************************************************************

__title__="FreeCAD Arch Curtain Wall"
__title__ = "FreeCAD Arch Curtain Wall"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

import math,sys
import FreeCAD
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Arch/ArchEquipment.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand All @@ -21,9 +20,9 @@
#* *
#***************************************************************************

__title__="FreeCAD Equipment"
__title__ = "FreeCAD Equipment"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

import FreeCAD,Draft,ArchComponent,DraftVecUtils,ArchCommands
from FreeCAD import Units
Expand Down
15 changes: 7 additions & 8 deletions src/Mod/Arch/ArchFloor.py
@@ -1,5 +1,4 @@
# -*- coding: utf8 -*-

#***************************************************************************
#* Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -51,9 +50,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
# Floors are used to group different Arch objects situated
# at a same level

__title__="FreeCAD Arch Floor"
__title__ = "FreeCAD Arch Floor"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

def makeFloor(objectslist=None,baseobj=None,name="Floor"):
"""Obsolete, superseded by ArchBuildingPart.makeFloor.
Expand Down Expand Up @@ -93,7 +92,7 @@ def makeFloor(objectslist=None,baseobj=None,name="Floor"):


class _CommandFloor:
"""The command definition for the Arch workbench's gui tool, Arch Floor.
"""The command definition for the Arch workbench's gui tool, Arch Floor.
A tool for creating Arch floors.
Expand All @@ -116,7 +115,7 @@ def GetResources(self):
'ToolTip': QT_TRANSLATE_NOOP("Arch_Floor","Creates a Building Part object that represents a level, including selected objects")}

def IsActive(self):
"""Determine whether or not the Arch Floor tool is active.
"""Determine whether or not the Arch Floor tool is active.
Inactive commands are indicated by a greyed-out icon in the menus and toolbars.
"""
Expand Down Expand Up @@ -176,7 +175,7 @@ class _Floor(ArchIFC.IfcProduct):
Turns a <App::DocumentObjectGroupPython> into a floor object, then
takes a list of objects to own as its children.
The floor can be based off either a group, or a python feature. Learn more
about groups here: https://wiki.freecadweb.org/Std_Group
Expand Down Expand Up @@ -254,7 +253,7 @@ def onChanged(self,obj,prop):

def execute(self,obj):
"""Method run when the object is recomputed.
Move its children if its placement has changed since the previous
recompute. Set any child Walls and Structures to have the height of
the floor if they have not Height value set.
Expand Down Expand Up @@ -341,7 +340,7 @@ def attach(self,vobj):
"""Add display modes' data to the coin scenegraph.
Add each display mode as a coin node, whose parent is this view
provider.
provider.
Each display mode's node includes the data needed to display the object
in that mode. This might include colors of faces, or the draw style of
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchFrame.py
Expand Up @@ -42,9 +42,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
# Frames are objects made of a profile and an object with
# edges along which the profile gets extruded

__title__="FreeCAD Arch Frame"
__title__ = "FreeCAD Arch Frame"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"


def makeFrame(baseobj,profile,name=translate("Arch","Frame")):
Expand Down
16 changes: 8 additions & 8 deletions src/Mod/Arch/ArchIFC.py
Expand Up @@ -174,7 +174,7 @@ def getCanonicalisedIfcTypes(self):

def getIfcAttributeSchema(self, ifcTypeSchema, name):
"""Get the schema of an IFC attribute with the given name.
Convert the IFC attribute's name from the human readable version Arch
uses, and convert it to the less readable name it has in the IFC
schema.
Expand Down Expand Up @@ -260,17 +260,17 @@ def addIfcAttribute(self, obj, attribute):

obj.IfcData = IfcData
if attribute["is_enum"]:
obj.addProperty("App::PropertyEnumeration",
attribute["name"],
"IFC Attributes",
obj.addProperty("App::PropertyEnumeration",
attribute["name"],
"IFC Attributes",
QT_TRANSLATE_NOOP("App::Property", "Description of IFC attributes are not yet implemented"))
setattr(obj, attribute["name"], attribute["enum_values"])
else:
import ArchIFCSchema
propertyType = "App::" + ArchIFCSchema.IfcTypes[attribute["type"]]["property"]
obj.addProperty(propertyType,
attribute["name"],
"IFC Attributes",
obj.addProperty(propertyType,
attribute["name"],
"IFC Attributes",
QT_TRANSLATE_NOOP("App::Property", "Description of IFC attributes are not yet implemented"))

def addIfcAttributeValueExpressions(self, obj, attribute):
Expand Down Expand Up @@ -420,7 +420,7 @@ def migrateDeprecatedAttributes(self, obj):
if r in IfcTypes:
obj.IfcType = r
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" IfcRole property to IfcType\n")

if "IfcAttributes"in obj.PropertiesList:
obj.IfcData = obj.IfcAttributes
obj.removeProperty("IfcAttributes")
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchIFCSchema.py
Expand Up @@ -5,11 +5,11 @@

import FreeCAD, os, json

ifcVersions = ["IFC4", "IFC2X3"]
ifcVersions = ["IFC4", "IFC2X3"]
IfcVersion = ifcVersions[FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("IfcVersion",0)]

with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets",
"ifc_contexts_" + IfcVersion + ".json")) as f:
"ifc_contexts_" + IfcVersion + ".json")) as f:
IfcContexts = json.load(f)

with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets",
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchIFCView.py
Expand Up @@ -142,13 +142,13 @@ def createLabel(self, value):

def createLineEdit(self, name):
"""Creates a form with the name specified.
Parameters
----------
name: str
The name of the datapoint within the RepresentationContexts
attribute being edited.
Returns
-------
<PySide2.QtWidgets.QWidget>
Expand Down
3 changes: 1 addition & 2 deletions src/Mod/Arch/ArchNesting.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

#***************************************************************************
#* Copyright (c) 2017 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -431,7 +430,7 @@ def run(self):
#for i,p in enumerate(faceverts):
# Draft.makeText([str(i)],point=p)
return

if pol.isValid():
nofitpol.append(pol)
#Part.show(pol)
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Arch/ArchPanel.py
Expand Up @@ -43,10 +43,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
# Panels consist of a closed shape that gets extruded to
# produce a flat object.


__title__="FreeCAD Panel"
__title__ = "FreeCAD Panel"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

# Description l w t

Expand Down
7 changes: 3 additions & 4 deletions src/Mod/Arch/ArchPipe.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

#***************************************************************************
#* Copyright (c) 2016 Yorik van Havre <yorik@uncreated.net> *
#* *
Expand Down Expand Up @@ -42,9 +41,9 @@ def QT_TRANSLATE_NOOP(ctxt,txt):
# This module provides tools to build Pipe and Pipe connector objects.
# Pipes are tubular objects extruded along a base line.

__title__ = "Arch Pipe tools"
__title__ = "Arch Pipe tools"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"


def makePipe(baseobj=None,diameter=0,length=0,placement=None,name="Pipe"):
Expand Down Expand Up @@ -248,7 +247,7 @@ def execute(self,obj):
import Draft
if Draft.getType(obj.Base) == "BezCurve":
v1 = obj.Base.Placement.multVec(obj.Base.Points[1])-w.Vertexes[0].Point
else:
else:
v1 = w.Vertexes[1].Point-w.Vertexes[0].Point
v2 = DraftGeomUtils.getNormal(p)
rot = FreeCAD.Rotation(v2,v1)
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Arch/ArchPrecast.py
Expand Up @@ -19,9 +19,9 @@
#* *
#***************************************************************************

__title__= "FreeCAD Precast concrete module"
__title__ = "FreeCAD Precast concrete module"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"

"""This module contains tools to build basic precast concrete elements:
Beams, pillars, slabs and panels"""
Expand Down Expand Up @@ -867,7 +867,7 @@ def __init__(self):
self.valueTread = FreeCADGui.UiLoader().createWidget("Gui::InputField")
self.grid.addWidget(self.labelTread,18,0,1,1)
self.grid.addWidget(self.valueTread,18,1,1,1)

# signals/slots
QtCore.QObject.connect(self.valueChamfer,QtCore.SIGNAL("valueChanged(double)"),self.setChamfer)
QtCore.QObject.connect(self.valueDentLength,QtCore.SIGNAL("valueChanged(double)"),self.setDentLength)
Expand Down

0 comments on commit 67381e9

Please sign in to comment.