Moved __init__ docstrings into the class docstring

This commit is contained in:
David Daish
2020-04-19 17:38:14 +12:00
committed by Yorik van Havre
parent 5f0438fb9c
commit 14283ea3ee
6 changed files with 84 additions and 152 deletions

View File

@@ -167,20 +167,14 @@ class Component(ArchIFC.IfcProduct):
You can learn more about Arch Components, and the purpose of Arch
Components here: https://wiki.freecadweb.org/Arch_Component
Parameters
----------
obj: <App::FeaturePython>
The object to turn into an Arch Component
"""
def __init__(self, obj):
"""Initialises the Component.
Registers the Proxy as this class object. Sets the object to have the
properties of an Arch component.
Parameters
----------
obj: <App::FeaturePython>
The object to turn into an Arch Component
"""
obj.Proxy = self
Component.setProperties(self, obj)
self.Type = "Component"
@@ -1507,30 +1501,27 @@ class ArchSelectionObserver:
TODO: This could probably use a rework. Most of the functionality isn't
used. It does not work correctly to reset the appearance of parent object
in ComponentTaskPanel.editObject(), for example.
Parameters
----------
watched: <App::DocumentObject>, optional
If no watched value is provided, functionality relating to origin
and hide parameters will not occur. Only the nextCommand will fire.
When a watched value is provided, the selection observer will only
fire when the watched object has been selected.
hide: bool
Sets if the watched object should be hidden.
origin: <App::DocumentObject, optional
If provided, and hide is True, will make the origin object
selectable, and opaque (set transparency to 0).
nextCommand: str
Name of Gui command to run when the watched object is selected, (if
one is specified), or when anything is selected (if no watched
object is specified).
"""
def __init__(self,origin=None,watched=None,hide=True,nextCommand=None):
"""Initialises the ArchSelectionObserver object.
Parameters
----------
watched: <App::DocumentObject>, optional
If no watched value is provided, functionality relating to origin
and hide parameters will not occur. Only the nextCommand will fire.
When a watched value is provided, the selection observer will only
fire when the watched object has been selected.
hide: bool
Sets if the watched object should be hidden.
origin: <App::DocumentObject, optional
If provided, and hide is True, will make the origin object
selectable, and opaque (set transparency to 0).
nextCommand: str
Name of Gui command to run when the watched object is selected, (if
one is specified), or when anything is selected (if no watched
object is specified).
"""
self.origin = origin
self.watched = watched
self.hide = hide
@@ -1587,13 +1578,6 @@ class SelectionTaskPanel:
"""
def __init__(self):
"""Initialises the task panel.
Adds a label.
TODO: Label does not seem to appear?
"""
self.baseform = QtGui.QLabel()
self.baseform.setText(QtGui.QApplication.translate("Arch", "Please select a base object", None))
@@ -1618,12 +1602,6 @@ class ComponentTaskPanel:
"""
def __init__(self):
"""Initialises the task panel.
Defines the layout of the task panel, and setups callbacks for when
buttons and menu items are clicked.
"""
# the panel has a tree widget that contains categories
# for the subcomponents, such as additions, subtractions.
# the categories are shown only if they are not empty.
@@ -2182,24 +2160,21 @@ if FreeCAD.GuiUp:
class IfcEditorDelegate(QtGui.QStyledItemDelegate):
"""This class manages the editing of the individual table cells in the IFC editor.
Parameters
----------
parent: <PySide2.QtWidgets.QWidget>
Unclear.
dialog: <ArchComponent.ComponentTaskPanel>
The dialog box this delegate was created in.
ptypes: list of str
A list of the names of IFC property types.
plables: list of str
A list of the human readable names of IFC property types.
"""
def __init__(self, parent=None, dialog=None, ptypes=[], plabels=[], *args):
"""This method initialises the class.
Parameters
----------
parent: <PySide2.QtWidgets.QWidget>
Unclear.
dialog: <ArchComponent.ComponentTaskPanel>
The dialog box this delegate was created in.
ptypes: list of str
A list of the names of IFC property types.
plables: list of str
A list of the human readable names of IFC property types.
"""
self.dialog = dialog
QtGui.QStyledItemDelegate.__init__(self, parent, *args)
self.ptypes = ptypes

View File

@@ -176,22 +176,19 @@ 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
Adds the properties of a floor, and sets its IFC type.
Parameters
----------
obj: <App::DocumentObjectGroupPython> or <App::FeaturePython>
The object to turn into a Floor.
"""
def __init__(self,obj):
"""Initialises the floor.
The floor can be based off either a group, or a python feature. Learn more
about groups here: https://wiki.freecadweb.org/Std_Group
Adds the properties of a floor, and sets its IFC type.
Parameters
----------
obj: <App::DocumentObjectGroupPython> or <App::FeaturePython>
The object to turn into a Floor.
"""
obj.Proxy = self
self.Object = obj
_Floor.setProperties(self,obj)
@@ -316,19 +313,15 @@ class _Floor(ArchIFC.IfcProduct):
class _ViewProviderFloor:
"""Obselete, superceeded by the ViewProviderBuildingPart class.
A View Provider for the Floor object."""
A View Provider for the Floor object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a floor view provider.
"""
def __init__(self,vobj):
"""Initialises the floor view provider.
Registers the Proxy as this class object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a floor view provider.
"""
vobj.Proxy = self
def getIcon(self):

View File

@@ -37,12 +37,6 @@ class IfcContextUI:
"""A default task panel for editing context objects."""
def __init__(self, object):
"""Initialises the task panel.
Defines the layout, and prefills the form with the
data already written to the object.
"""
self.object = object
self.lineEditObjects = []
self.createBaseLayout()

View File

@@ -137,19 +137,14 @@ class _Project(ArchIFC.IfcContext):
Takes a <Part::FeaturePython>, and turns it into a Project. Then takes a
list of Arch sites to own as its children.
Parameters
----------
obj: <App::DocumentObjectGroupPython> or <App::FeaturePython>
The object to turn into a Project.
"""
def __init__(self, obj):
"""Initialises the project.
Adds the properties of a project, and sets its IFC type.
Parameters
----------
obj: <App::DocumentObjectGroupPython> or <App::FeaturePython>
The object to turn into a Project.
"""
obj.Proxy = self
self.setProperties(obj)
obj.IfcType = "Project"
@@ -172,19 +167,15 @@ class _Project(ArchIFC.IfcContext):
self.setProperties(obj)
class _viewproviderproject(ArchIFCView.IfcContextView):
"""A View Provider for the project object."""
"""A View Provider for the project object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a project view provider.
"""
def __init__(self,vobj):
"""Initialises the project view provider.
Registers the Proxy as this class object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a project view provider.
"""
vobj.Proxy = self
vobj.addExtension("Gui::ViewProviderGroupExtensionPython", self)

View File

@@ -531,21 +531,16 @@ class _Site(ArchIFC.IfcProduct):
with additions and subtractions as earthmoving, calculating volumes of
terrain that have been moved by the additions and subtractions. Unlike most
Arch objects, the Terrain object works well as a mesh.
The site must be based off a <Part::FeaturePython> object.
Parameters
----------
obj: <Part::FeaturePython>
The object to turn into a site.
"""
def __init__(self,obj):
"""Initialises the site.
The site must be based off a <Part::FeaturePython> object.
Adds the properties of a site, and sets its IFC type.
Parameters
----------
obj: <Part::FeaturePython>
The object to turn into a site.
"""
obj.Proxy = self
self.setProperties(obj)
obj.IfcType = "Site"
@@ -774,20 +769,15 @@ class _Site(ArchIFC.IfcProduct):
obj.AdditionVolume = addvol
class _ViewProviderSite:
"""A View Provider for the Site object"""
"""A View Provider for the Site object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a site view provider.
"""
def __init__(self,vobj):
"""Initialises the site view provider.
Registers the Proxy as this class object. Sets the view provider to have the
properties of a site view provider.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a site view provider.
"""
vobj.Proxy = self
vobj.addExtension("Gui::ViewProviderGroupExtensionPython", self)
self.setProperties(vobj)

View File

@@ -689,12 +689,6 @@ class _Wall(ArchComponent.Component):
"""
def __init__(self, obj):
"""Initialises the object's properties.
Sets the object to have the properties of an Arch component, and Arch
wall.
"""
ArchComponent.Component.__init__(self, obj)
self.setProperties(obj)
obj.IfcType = "Wall"
@@ -1503,20 +1497,15 @@ class _Wall(ArchComponent.Component):
return None
class _ViewProviderWall(ArchComponent.ViewProviderComponent):
"""The view provider for the wall object."""
"""The view provider for the wall object.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a wall view provider.
"""
def __init__(self,vobj):
"""Initialises the wall view provider.
Runs the Arch Component view provider initialisation, and sets the color
to the default for walls.
Parameters
----------
vobj: <Gui.ViewProviderDocumentObject>
The view provider to turn into a wall view provider.
"""
ArchComponent.ViewProviderComponent.__init__(self,vobj)
vobj.ShapeColor = ArchCommands.getDefaultColor("Wall")