Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
I created this PR while reading through the code to create documentation on the wiki
  • Loading branch information
luzpaz committed Dec 4, 2020
1 parent 9062f29 commit b1b0577
Show file tree
Hide file tree
Showing 44 changed files with 276 additions and 171 deletions.
12 changes: 11 additions & 1 deletion freecad/Curves/Birail.py
@@ -1,3 +1,10 @@
# -*- coding: utf-8 -*-

__title__ = "Birail"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Birail object to use with Sweep on 2 rails tool"

import math
import os
import dummy
Expand Down Expand Up @@ -176,6 +183,9 @@ def Activated(self):
FreeCAD.ActiveDocument.recompute()

def GetResources(self):
return {'Pixmap' : path_curvesWB_icons+'/birail.svg', 'MenuText': 'Birail', 'ToolTip': 'Birail object to use with Sweep on 2 rails tool'}
return {'Pixmap' : path_curvesWB_icons+'/birail.svg',
'MenuText': 'Birail',
'ToolTip': ''
}

FreeCADGui.addCommand('Birail', birailcommand())
14 changes: 7 additions & 7 deletions freecad/Curves/Discretize.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Discretize"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Discretize"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Discretize an edge or a wire."
__doc__ = "Discretize an edge or a wire."

import os
import FreeCAD
Expand Down Expand Up @@ -289,9 +289,9 @@ def IsActive(self):


def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': 'Discretize', 'ToolTip': 'Discretize an edge or a wire'}
return {'Pixmap' : TOOL_ICON,
'MenuText': 'Discretize',
'ToolTip': 'Discretize an edge or a wire'
}

FreeCADGui.addCommand('Discretize', discretize())



13 changes: 8 additions & 5 deletions freecad/Curves/ExtractShapes.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Extract subshape"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Extract subshape"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Extract selected subshapes from objects."
__doc__ = "Extract selected subshapes from objects."

import os
import FreeCAD
Expand Down Expand Up @@ -32,6 +32,9 @@ def Activated(self):
FreeCAD.ActiveDocument.recompute()

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': 'Extract', 'ToolTip': 'Extract selected subshapes from objects'}
return {'Pixmap' : TOOL_ICON,
'MenuText': 'Extract',
'ToolTip': 'Extract selected subshapes from objects'
}

FreeCADGui.addCommand('extract', extract())
FreeCADGui.addCommand('extract', extract())
6 changes: 3 additions & 3 deletions freecad/Curves/FaceMapFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Face Map"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Face Map"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Flat map of a 3D face"""
__doc__ = "Flat map of a 3D face

import os
import FreeCAD
Expand Down
11 changes: 7 additions & 4 deletions freecad/Curves/HQRuledSurfaceFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "HQ Ruled surface"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "HQ Ruled surface"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """High Quality ruled surface.
__doc__ = """High Quality ruled surface.
The 2 edges (or wires) are reparametrized before surface creation."""

import sys
Expand Down Expand Up @@ -176,6 +176,9 @@ def IsActive(self):
return(False)

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('hq_ruled_surface', HQ_Ruled_Surface_Command())
11 changes: 7 additions & 4 deletions freecad/Curves/HelicalSweepFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Helical Sweep"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Helical Sweep"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Sweep an open wire along an helical path"""
__doc__ = "Sweep an open wire along an helical path"

import sys
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -281,6 +281,9 @@ def IsActive(self):
return False

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('HelicalSweep', HelicalSweepCommand())
9 changes: 5 additions & 4 deletions freecad/Curves/JoinCurves.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "joinCurves"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "joinCurves"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Joins the selected edges into BSpline Curves"
__doc__ = "Joins the selected edges into BSpline Curves"

import os
import FreeCAD
Expand Down Expand Up @@ -227,7 +227,8 @@ def IsActive(self):
def GetResources(self):
return {'Pixmap': TOOL_ICON,
'MenuText': 'Join Curves',
'ToolTip': 'Joins the selected edges into BSpline Curves'}
'ToolTip': 'Joins the selected edges into BSpline Curves'
}


FreeCADGui.addCommand('join', joinCommand())
11 changes: 7 additions & 4 deletions freecad/Curves/OrientedSketchFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Oriented sketch"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Oriented sketch"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Sketch normal to an edge, with up vector normal to a face"""
__doc__ = "Sketch normal to an edge, with up vector normal to a face"

import sys
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -160,6 +160,9 @@ def IsActive(self):
return False

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('oriented_sketch', oriented_sketch_cmd())
11 changes: 7 additions & 4 deletions freecad/Curves/Outline_FP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Outline Curve"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Outline Curve"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Outline curve of a shape"""
__doc__ = "Outline curve of a shape"

import sys
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -153,6 +153,9 @@ def IsActive(self):
return(False)

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('outline', outline_cmd())
11 changes: 7 additions & 4 deletions freecad/Curves/ParametricBlendCurve.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Blend curve"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Blend curve"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Blend curve between two edges."
__doc__ = "Blend curve between two edges."

import os
import FreeCAD
Expand Down Expand Up @@ -578,7 +578,10 @@ def Activated(self):
FreeCAD.ActiveDocument.recompute()

def GetResources(self):
return {'Pixmap': TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap': TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}


FreeCADGui.addCommand('ParametricBlendCurve', ParametricBlendCurve())
13 changes: 8 additions & 5 deletions freecad/Curves/ParametricComb.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Comb plot"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Comb plot"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = 'Creates a parametric Comb plot on selected edges'
__doc__ = 'Creates a parametric Comb plot on selected edges'

import os
import FreeCAD
Expand Down Expand Up @@ -589,9 +589,12 @@ def Activated(self):
ViewProviderComb(obj.ViewObject)
else:
self.appendEdges(combSelected, edges)

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('ParametricComb', ParametricComb())

Expand Down
11 changes: 7 additions & 4 deletions freecad/Curves/ProfileSketch.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = 'Profile support plane'
__author__ = "Christophe Grellier (Chris_G)"
__title__ = 'Profile support plane'
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = 'Creates a support plane for sketches'
__doc__ = 'Creates a support plane for sketches'

import os
import FreeCAD
Expand Down Expand Up @@ -149,6 +149,9 @@ def IsActive(self):
return(False)

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

FreeCADGui.addCommand('profileSupportCmd', profSupCommand())
11 changes: 7 additions & 4 deletions freecad/Curves/ReflectLinesFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Reflect Lines"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Reflect Lines"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Creates the reflect lines on a shape, according to a view direction"""
__doc__ = "Creates the reflect lines on a shape, according to a view direction"

import sys
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -138,7 +138,10 @@ def IsActive(self):
return(False)

def GetResources(self):
return {'Pixmap' : TOOL_ICON, 'MenuText': __title__, 'ToolTip': __doc__}
return {'Pixmap' : TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__
}

def run():
ReflectLinesCommand().Activated()
Expand Down
9 changes: 5 additions & 4 deletions freecad/Curves/Sketch_On_Surface.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Sketch on surface"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Sketch on surface"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Map a sketch on a surface"
__doc__ = "Map a sketch on a surface"

import os
import FreeCAD
Expand Down Expand Up @@ -461,7 +461,8 @@ def Activated(self):
def GetResources(self):
return {'Pixmap': TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__}
'ToolTip': __doc__
}


FreeCADGui.addCommand('SoS', SoS())
9 changes: 5 additions & 4 deletions freecad/Curves/TemplateFP.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Face Map"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Face Map"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = """Flat map of a 3D face"""
__doc__ = "Flat map of a 3D face"

import os
import FreeCAD
Expand Down Expand Up @@ -125,7 +125,8 @@ def IsActive(self):
def GetResources(self):
return {'Pixmap': TOOL_ICON,
'MenuText': __title__,
'ToolTip': __doc__}
'ToolTip': __doc__
}


FreeCADGui.addCommand('tool_name', ToolCommand())
6 changes: 3 additions & 3 deletions freecad/Curves/_utils.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Curves workbench utilities"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Curves workbench utilities"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Curves workbench utilities common to all tools."
__doc__ = "Curves workbench utilities common to all tools."

import FreeCAD
import Part
Expand Down
10 changes: 5 additions & 5 deletions freecad/Curves/adjacent_faces.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

__title__ = "Select Adjacent faces"
__author__ = "Christophe Grellier (Chris_G)"
__title__ = "Select Adjacent faces"
__author__ = "Christophe Grellier (Chris_G)"
__license__ = "LGPL 2.1"
__doc__ = "Select the Adjacent faces of the selected subshape"
__doc__ = "Select the Adjacent faces of the selected subshape"

# import FreeCAD
from FreeCADGui import Selection as sel
Expand Down Expand Up @@ -66,7 +66,7 @@ def IsActive(self):
def GetResources(self):
return {'Pixmap': TOOL_ICON,
'MenuText': 'Adjacent faces',
'ToolTip': 'Select the adjacent faces of the selected shape'}

'ToolTip': 'Select the adjacent faces of the selected shape'
}

addCommand('adjacent_faces', adjacentfacesCommand())

0 comments on commit b1b0577

Please sign in to comment.