From 14283ea3ee3756b234ff9b8664521e7040f635dc Mon Sep 17 00:00:00 2001 From: David Daish Date: Sun, 19 Apr 2020 17:38:14 +1200 Subject: [PATCH] Moved __init__ docstrings into the class docstring --- src/Mod/Arch/ArchComponent.py | 93 +++++++++++++---------------------- src/Mod/Arch/ArchFloor.py | 41 +++++++-------- src/Mod/Arch/ArchIFCView.py | 6 --- src/Mod/Arch/ArchProject.py | 33 +++++-------- src/Mod/Arch/ArchSite.py | 38 ++++++-------- src/Mod/Arch/ArchWall.py | 25 +++------- 6 files changed, 84 insertions(+), 152 deletions(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 1905d70544..2e818041cb 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -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: + 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: - 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: , 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: , 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: + Unclear. + dialog: + 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: - Unclear. - dialog: - 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 diff --git a/src/Mod/Arch/ArchFloor.py b/src/Mod/Arch/ArchFloor.py index a1cdecacef..844be1b8d6 100644 --- a/src/Mod/Arch/ArchFloor.py +++ b/src/Mod/Arch/ArchFloor.py @@ -176,22 +176,19 @@ class _Floor(ArchIFC.IfcProduct): Turns a 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: or + 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: or - 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: + 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: - The view provider to turn into a floor view provider. - """ - vobj.Proxy = self def getIcon(self): diff --git a/src/Mod/Arch/ArchIFCView.py b/src/Mod/Arch/ArchIFCView.py index 744e7ebc8d..4cfb884186 100644 --- a/src/Mod/Arch/ArchIFCView.py +++ b/src/Mod/Arch/ArchIFCView.py @@ -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() diff --git a/src/Mod/Arch/ArchProject.py b/src/Mod/Arch/ArchProject.py index f776edb8c4..ae6da55776 100644 --- a/src/Mod/Arch/ArchProject.py +++ b/src/Mod/Arch/ArchProject.py @@ -137,19 +137,14 @@ class _Project(ArchIFC.IfcContext): Takes a , and turns it into a Project. Then takes a list of Arch sites to own as its children. + + Parameters + ---------- + obj: or + 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: or - 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: + 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: - The view provider to turn into a project view provider. - """ - vobj.Proxy = self vobj.addExtension("Gui::ViewProviderGroupExtensionPython", self) diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index e7b80c8bee..497ea43efa 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -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 object. + + Parameters + ---------- + obj: + The object to turn into a site. """ def __init__(self,obj): - """Initialises the site. - - The site must be based off a object. - - Adds the properties of a site, and sets its IFC type. - - Parameters - ---------- - obj: - 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: + 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: - The view provider to turn into a site view provider. - """ - vobj.Proxy = self vobj.addExtension("Gui::ViewProviderGroupExtensionPython", self) self.setProperties(vobj) diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 77378bb27b..fe6e113bf6 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -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: + 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: - The view provider to turn into a wall view provider. - """ - ArchComponent.ViewProviderComponent.__init__(self,vobj) vobj.ShapeColor = ArchCommands.getDefaultColor("Wall")