Fix various indentation issues (tabs->spaces)

This commit is contained in:
luzpaz
2023-01-23 15:43:09 +00:00
committed by Uwe
parent a884da5890
commit 5d3f56989d
22 changed files with 633 additions and 633 deletions

View File

@@ -6,99 +6,99 @@ import Draft
from FreeCAD import Base
circ1= Part.makeCircle(
5,
FreeCAD.Vector(10,18,10), FreeCAD.Vector(1,0,0))
5,
FreeCAD.Vector(10,18,10), FreeCAD.Vector(1,0,0))
circ2 = Part.makeCircle(5)
def DrawMyPart(points, extrude):
obj1 = Draft.makeWire(points,closed=True,face=True,support=None)
face1 = Part.Face(obj1.Shape)
body1= face1.extrude(extrude)
Part.show(body1)
obj1 = Draft.makeWire(points,closed=True,face=True,support=None)
face1 = Part.Face(obj1.Shape)
body1= face1.extrude(extrude)
Part.show(body1)
# part1
DrawMyPart([
FreeCAD.Vector(0,0,0),
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(45,20,0),
FreeCAD.Vector(0,20,0),
], Base.Vector(0,0,4))
FreeCAD.Vector(0,0,0),
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(45,20,0),
FreeCAD.Vector(0,20,0),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(0,20,0),
FreeCAD.Vector(0,180,0),
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(25,20,0),
], Base.Vector(0,0,4))
FreeCAD.Vector(0,20,0),
FreeCAD.Vector(0,180,0),
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(25,20,0),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(0,180,0),
FreeCAD.Vector(0,200,0),
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(45,180,0),
], Base.Vector(0,0,4))
FreeCAD.Vector(0,180,0),
FreeCAD.Vector(0,200,0),
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(45,180,0),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(25,20,0),
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(25,180,9.2),
FreeCAD.Vector(25,20,9.2),
], Base.Vector(0,0,4))
FreeCAD.Vector(25,20,0),
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(25,180,9.2),
FreeCAD.Vector(25,20,9.2),
], Base.Vector(0,0,4))
# part2
points=[
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(45,200,0),
]
DrawMyPart([
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,180,25),
FreeCAD.Vector(45,180,0),
], Base.Vector(0,0,4))
FreeCAD.Vector(45,200,0),
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,180,25),
FreeCAD.Vector(45,180,0),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(68,180,25),
FreeCAD.Vector(56.7,180,13),
FreeCAD.Vector(56.7,20,13),
FreeCAD.Vector(68,20,25),
], Base.Vector(0,0,4))
FreeCAD.Vector(68,180,25),
FreeCAD.Vector(56.7,180,13),
FreeCAD.Vector(56.7,20,13),
FreeCAD.Vector(68,20,25),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(68,20,25),
FreeCAD.Vector(45,20,0),
], Base.Vector(0,0,4))
FreeCAD.Vector(45,0,0),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(68,20,25),
FreeCAD.Vector(45,20,0),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(25,20,0),
FreeCAD.Vector(45,20,0),
FreeCAD.Vector(45,20,9.2),
FreeCAD.Vector(25,20,9.2),
], Base.Vector(0,0,4))
FreeCAD.Vector(25,20,0),
FreeCAD.Vector(45,20,0),
FreeCAD.Vector(45,20,9.2),
FreeCAD.Vector(25,20,9.2),
], Base.Vector(0,0,4))
DrawMyPart([
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(45,180,0),
FreeCAD.Vector(45,180,9.2),
FreeCAD.Vector(25,180,9.2),
], Base.Vector(0,0,4))
FreeCAD.Vector(25,180,0),
FreeCAD.Vector(45,180,0),
FreeCAD.Vector(45,180,9.2),
FreeCAD.Vector(25,180,9.2),
], Base.Vector(0,0,4))
# part3
DrawMyPart([
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,200,35),
FreeCAD.Vector(68,0,35),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(68,200,25),
], Base.Vector(0,0,4))
FreeCAD.Vector(68,200,25),
FreeCAD.Vector(68,200,35),
FreeCAD.Vector(68,0,35),
FreeCAD.Vector(68,0,25),
FreeCAD.Vector(68,200,25),
], Base.Vector(0,0,4))
circ1= Draft.makeCircle(
5,
Base.Placement(10,18,10),
FreeCAD.Vector(1,0,0))
5,
Base.Placement(10,18,10),
FreeCAD.Vector(1,0,0))
circ2 = Draft.makeCircle(5)

View File

@@ -236,8 +236,8 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
make fc_version
for I in src/Build/Version.h src/Build/Version.h.out; do
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git master\",' $I
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git master\",' $I
done
%{make_build}

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="ExtensionContainerPy"
Name="DocumentObjectPy"
Twin="DocumentObject"
TwinPointer="DocumentObject"
Include="App/DocumentObject.h"
Namespace="App"
FatherInclude="App/ExtensionContainerPy.h"
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>This is the father of all classes handled by the document</UserDocu>
</Documentation>
<PythonExport
Father="ExtensionContainerPy"
Name="DocumentObjectPy"
Twin="DocumentObject"
TwinPointer="DocumentObject"
Include="App/DocumentObject.h"
Namespace="App"
FatherInclude="App/ExtensionContainerPy.h"
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>This is the father of all classes handled by the document</UserDocu>
</Documentation>
<Methode Name="addProperty">
<Documentation>
<UserDocu>
@@ -36,15 +36,15 @@
</Documentation>
</Methode>
<Methode Name="touch">
<Documentation>
<UserDocu>Mark the object as changed (touched)</UserDocu>
</Documentation>
</Methode>
<Methode Name="purgeTouched">
<Documentation>
<UserDocu>Mark the object as unchanged</UserDocu>
</Documentation>
</Methode>
<Documentation>
<UserDocu>Mark the object as changed (touched)</UserDocu>
</Documentation>
</Methode>
<Methode Name="purgeTouched">
<Documentation>
<UserDocu>Mark the object as unchanged</UserDocu>
</Documentation>
</Methode>
<Methode Name="enforceRecompute">
<Documentation>
<UserDocu>Mark the object for recompute</UserDocu>
@@ -147,27 +147,27 @@ containing the accumulated transformation matrix
</UserDocu>
</Documentation>
</Methode>
<Methode Name="setElementVisible">
<Documentation>
<Methode Name="setElementVisible">
<Documentation>
<UserDocu>
setElementVisible(element,visible): Set the visibility of a child element
Return -1 if element visibility is not supported, 0 if element not found, 1 if success
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isElementVisible">
<Documentation>
</Documentation>
</Methode>
<Methode Name="isElementVisible">
<Documentation>
<UserDocu>
isElementVisible(element): Check if a child element is visible
Return -1 if element visibility is not supported or element not found, 0 if invisible, or else 1
</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasChildElement">
<Documentation>
</Documentation>
</Methode>
<Methode Name="hasChildElement">
<Documentation>
<UserDocu>Return true to indicate the object having child elements</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="getParentGroup">
<Documentation>
<UserDocu>Returns the group the object is in or None if it is not part of a group.
@@ -249,11 +249,11 @@ Return tuple(obj,newElementName,oldElementName)
<Parameter Name="FullName" Type="String"/>
</Attribute>
<Attribute Name="Name" ReadOnly="true">
<Documentation>
<UserDocu>Return the internal name of this object</UserDocu>
</Documentation>
<Parameter Name="Name" Type="String"/>
</Attribute>
<Documentation>
<UserDocu>Return the internal name of this object</UserDocu>
</Documentation>
<Parameter Name="Name" Type="String"/>
</Attribute>
<Attribute Name="Document" ReadOnly="true">
<Documentation>
<UserDocu>Return the document this object is part of</UserDocu>
@@ -261,54 +261,54 @@ Return tuple(obj,newElementName,oldElementName)
<Parameter Name="Document" Type="Object"/>
</Attribute>
<Attribute Name="State" ReadOnly="true">
<Documentation>
<UserDocu>State of the object in the document</UserDocu>
</Documentation>
<Parameter Name="State" Type="List"/>
</Attribute>
<Attribute Name="ViewObject" ReadOnly="true">
<Documentation>
<UserDocu>If the GUI is loaded the associated view provider is returned
<Documentation>
<UserDocu>State of the object in the document</UserDocu>
</Documentation>
<Parameter Name="State" Type="List"/>
</Attribute>
<Attribute Name="ViewObject" ReadOnly="true">
<Documentation>
<UserDocu>If the GUI is loaded the associated view provider is returned
or None if the GUI is not up</UserDocu>
</Documentation>
<Parameter Name="ViewObject" Type="Object"/>
</Attribute>
<CustomAttributes />
<Attribute Name="MustExecute" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="ViewObject" Type="Object"/>
</Attribute>
<CustomAttributes />
<Attribute Name="MustExecute" ReadOnly="true">
<Documentation>
<UserDocu>Check if the object must be recomputed</UserDocu>
</Documentation>
<Parameter Name="MustExecute" Type="Boolean"/>
</Attribute>
<Attribute Name="ID" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="MustExecute" Type="Boolean"/>
</Attribute>
<Attribute Name="ID" ReadOnly="true">
<Documentation>
<UserDocu>The unique identifier (among its document) of this object</UserDocu>
</Documentation>
<Parameter Name="ID" Type="Int"/>
</Attribute>
<Attribute Name="Removing" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="ID" Type="Int"/>
</Attribute>
<Attribute Name="Removing" ReadOnly="true">
<Documentation>
<UserDocu>Indicate if the object is being removed</UserDocu>
</Documentation>
<Parameter Name="Removing" Type="Boolean"/>
</Attribute>
</Documentation>
<Parameter Name="Removing" Type="Boolean"/>
</Attribute>
<Attribute Name="Parents" ReadOnly="true">
<Documentation>
<UserDocu>A List of tuple(parent,subname) holding all parents to this object</UserDocu>
</Documentation>
<Parameter Name="Parents" Type="List"/>
<Parameter Name="Parents" Type="List"/>
</Attribute>
<Attribute Name="OldLabel" ReadOnly="true">
<Documentation>
<UserDocu>Contains the old label before change</UserDocu>
</Documentation>
<Parameter Name="OldLabel" Type="String"/>
<Parameter Name="OldLabel" Type="String"/>
</Attribute>
<Attribute Name="NoTouch">
<Documentation>
<UserDocu>Enable/disable no touch on any property change</UserDocu>
</Documentation>
<Parameter Name="NoTouch" Type="Boolean"/>
<Parameter Name="NoTouch" Type="Boolean"/>
</Attribute>
</PythonExport>
</PythonExport>
</GenerateModel>

View File

@@ -198,23 +198,23 @@ object of this document.
</Documentation>
</Methode>
<Methode Name="getObject">
<Documentation>
<UserDocu>Return the object with the given name</UserDocu>
</Documentation>
</Methode>
<Methode Name="getObjectsByLabel">
<Documentation>
<UserDocu>Return the objects with the given label name.
<Documentation>
<UserDocu>Return the object with the given name</UserDocu>
</Documentation>
</Methode>
<Methode Name="getObjectsByLabel">
<Documentation>
<UserDocu>Return the objects with the given label name.
NOTE: It's possible that several objects have the same label name.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="findObjects" Keyword="true">
<Documentation>
<Documentation>
<UserDocu>findObjects([Type=string], [Name=string], [Label=string]) -&gt; list
Return a list of objects that match the specified type, name or label.
Name and label support regular expressions. All parameters are optional.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="getLinksTo">
<Documentation>
<UserDocu>
@@ -225,18 +225,18 @@ maxCount: to limit the number of links returned
</UserDocu>
</Documentation>
</Methode>
<Methode Name="supportedTypes">
<Documentation>
<UserDocu>A list of supported types of objects</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTempFileName">
<Documentation>
<UserDocu>Returns a file name with path in the temp directory of the document.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDependentDocuments">
<Documentation>
<Methode Name="supportedTypes">
<Documentation>
<UserDocu>A list of supported types of objects</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTempFileName">
<Documentation>
<UserDocu>Returns a file name with path in the temp directory of the document.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDependentDocuments">
<Documentation>
<UserDocu>
getDependentDocuments(sort=True)
@@ -244,21 +244,21 @@ Returns a list of documents that this document directly or indirectly links to i
sort: whether to topologically sort the return list
</UserDocu>
</Documentation>
</Methode>
<Attribute Name="DependencyGraph" ReadOnly="true">
<Documentation>
<UserDocu>The dependency graph as GraphViz text</UserDocu>
</Documentation>
<Parameter Name="DependencyGraph" Type="String" />
</Attribute>
<Attribute Name="ActiveObject" ReadOnly="true">
<Documentation>
<UserDocu>The active object of the document</UserDocu>
</Documentation>
<Parameter Name="ActiveObject" Type="Object" />
</Attribute>
<Attribute Name="Objects" ReadOnly="true">
</Documentation>
</Methode>
<Attribute Name="DependencyGraph" ReadOnly="true">
<Documentation>
<UserDocu>The dependency graph as GraphViz text</UserDocu>
</Documentation>
<Parameter Name="DependencyGraph" Type="String" />
</Attribute>
<Attribute Name="ActiveObject" ReadOnly="true">
<Documentation>
<UserDocu>The active object of the document</UserDocu>
</Documentation>
<Parameter Name="ActiveObject" Type="Object" />
</Attribute>
<Attribute Name="Objects" ReadOnly="true">
<Documentation>
<UserDocu>The list of object handled by this document</UserDocu>
</Documentation>
@@ -330,48 +330,48 @@ sort: whether to topologically sort the return list
</Documentation>
<Parameter Name="HasPendingTransaction" Type="Boolean"/>
</Attribute>
<Attribute Name="InList" ReadOnly="true">
<Documentation>
<Attribute Name="InList" ReadOnly="true">
<Documentation>
<UserDocu>A list of all documents that link to this document.</UserDocu>
</Documentation>
<Parameter Name="InList" Type="List" />
</Attribute>
<Attribute Name="OutList" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="InList" Type="List" />
</Attribute>
<Attribute Name="OutList" ReadOnly="true">
<Documentation>
<UserDocu>A list of all documents that this document links to.</UserDocu>
</Documentation>
<Parameter Name="OutList" Type="List" />
</Attribute>
<Attribute Name="Restoring" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="OutList" Type="List" />
</Attribute>
<Attribute Name="Restoring" ReadOnly="true">
<Documentation>
<UserDocu>Indicate if the document is restoring</UserDocu>
</Documentation>
<Parameter Name="Restoring" Type="Boolean" />
</Attribute>
<Attribute Name="Partial" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="Restoring" Type="Boolean" />
</Attribute>
<Attribute Name="Partial" ReadOnly="true">
<Documentation>
<UserDocu>Indicate if the document is partially loaded</UserDocu>
</Documentation>
<Parameter Name="Partial" Type="Boolean" />
</Attribute>
<Attribute Name="Importing" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="Partial" Type="Boolean" />
</Attribute>
<Attribute Name="Importing" ReadOnly="true">
<Documentation>
<UserDocu>Indicate if the document is importing. Note the document will also report Restoring while importing</UserDocu>
</Documentation>
<Parameter Name="Importing" Type="Boolean" />
</Attribute>
<Attribute Name="Recomputing" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="Importing" Type="Boolean" />
</Attribute>
<Attribute Name="Recomputing" ReadOnly="true">
<Documentation>
<UserDocu>Indicate if the document is recomputing</UserDocu>
</Documentation>
<Parameter Name="Recomputing" Type="Boolean" />
</Attribute>
<Attribute Name="Transacting" ReadOnly="true">
<Documentation>
</Documentation>
<Parameter Name="Recomputing" Type="Boolean" />
</Attribute>
<Attribute Name="Transacting" ReadOnly="true">
<Documentation>
<UserDocu>Indicate whether the document is undoing/redoing</UserDocu>
</Documentation>
<Parameter Name="Transacting" Type="Boolean" />
</Attribute>
</Documentation>
<Parameter Name="Transacting" Type="Boolean" />
</Attribute>
<Attribute Name="OldLabel" ReadOnly="true">
<Documentation>
<UserDocu>Contains the old label before change</UserDocu>

View File

@@ -43,12 +43,12 @@
<UserDocu>Remove multiple objects from the group. Expects a list and returns all objects that have been removed.</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeObjectsFromDocument">
<Documentation>
<UserDocu>Remove all child objects from the group and document</UserDocu>
</Documentation>
</Methode>
<Methode Name="getObject">
<Methode Name="removeObjectsFromDocument">
<Documentation>
<UserDocu>Remove all child objects from the group and document</UserDocu>
</Documentation>
</Methode>
<Methode Name="getObject">
<Documentation>
<UserDocu>Return the object with the given name</UserDocu>
</Documentation>

View File

@@ -33,13 +33,13 @@ name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTypeOfProperty">
<Documentation>
<UserDocu>getTypeOfProperty(name) -> list\n
<Documentation>
<UserDocu>getTypeOfProperty(name) -> list\n
Returns the type of a named property. This can be a list conformed by elements in
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="getTypeIdOfProperty">
<Documentation>
<UserDocu>getTypeIdOfProperty(name) -> str\n
@@ -70,21 +70,21 @@ name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGroupOfProperty">
<Documentation>
<UserDocu>getGroupOfProperty(name) -> str\n
<Documentation>
<UserDocu>getGroupOfProperty(name) -> str\n
Returns the name of the group which the property belongs to in this class.
The properties are sorted in different named groups for convenience.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="setGroupOfProperty">
<Documentation>
<UserDocu>setGroupOfProperty(name, group) -> None\n
<Documentation>
<UserDocu>setGroupOfProperty(name, group) -> None\n
Set the name of the group of a dynamic property.\n
name : str\n Property name.
group : str\n Group name.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="setPropertyStatus">
<Documentation>
<UserDocu>setPropertyStatus(name, val) -> None\n
@@ -101,29 +101,29 @@ Get property status.\n
name : str\n Property name. If empty, returns a list of supported text names of the status.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDocumentationOfProperty">
<Documentation>
<UserDocu>getDocumentationOfProperty(name) -> str\n
<Methode Name="getDocumentationOfProperty">
<Documentation>
<UserDocu>getDocumentationOfProperty(name) -> str\n
Returns the documentation string of the property of this class.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setDocumentationOfProperty">
<Documentation>
<UserDocu>setDocumentationOfProperty(name, docstring) -> None\n
</Documentation>
</Methode>
<Methode Name="setDocumentationOfProperty">
<Documentation>
<UserDocu>setDocumentationOfProperty(name, docstring) -> None\n
Set the documentation string of a dynamic property of this class.\n
name : str\n Property name.
docstring : str\n Documentation string.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEnumerationsOfProperty">
<Documentation>
<UserDocu>getEnumerationsOfProperty(name) -> list or None\n
</Documentation>
</Methode>
<Methode Name="getEnumerationsOfProperty">
<Documentation>
<UserDocu>getEnumerationsOfProperty(name) -> list or None\n
Return all enumeration strings of the property of this class or None if not a
PropertyEnumeration.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
</Documentation>
</Methode>
<Methode Name="dumpPropertyContent" Keyword="true" Const="true">
<Documentation>
<UserDocu>dumpPropertyContent(Property, Compression=3) -> bytearray\n

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
To verify the user.cfg file against the XSD scheme add the following to the FCParameters element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XSD_FILE_PATH"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XSD_FILE_PATH"
-->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="FCParameters">

View File

@@ -57,7 +57,7 @@ if(BUILD_GUI)
)
elseif(APPLE AND NOT BUILD_WITH_CONDA)
INSTALL(TARGETS FreeCADMain
RUNTIME DESTINATION MacOS
RUNTIME DESTINATION MacOS
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else()

View File

@@ -37,39 +37,39 @@ FreeCAD.addExportType("glTF (*.gltf *.glb)","ImportGui")
"""
class ImportWorkbench ( Workbench ):
"Import workbench object"
def Activate(self):
# load the module
try:
Log ('Loading ImportGui module')
import Import
import ImportGui
except ImportError:
Err('Cannot load ImportGui')
raise
def GetIcon(self):
# returns an icon for the workbench
return ["/* XPM */\n"
"static const char *fileopen[] = {\n"
"\"16 13 5 1\",\n"
"\". c #040404\",\n"
"\"# c #808304\",\n"
"\"a c None\",\n"
"\"b c #f3f704\",\n"
"\"c c #f3f7f3\",\n"
"\"aaaaaaaaa...aaaa\",\n"
"\"aaaaaaaa.aaa.a.a\",\n"
"\"aaaaaaaaaaaaa..a\",\n"
"\"a...aaaaaaaa...a\",\n"
"\".bcb.......aaaaa\",\n"
"\".cbcbcbcbc.aaaaa\",\n"
"\".bcbcbcbcb.aaaaa\",\n"
"\".cbcb...........\",\n"
"\".bcb.#########.a\",\n"
"\".cb.#########.aa\",\n"
"\".b.#########.aaa\",\n"
"\"..#########.aaaa\",\n"
"\"...........aaaaa\"};\n"]
"Import workbench object"
def Activate(self):
# load the module
try:
Log ('Loading ImportGui module')
import Import
import ImportGui
except ImportError:
Err('Cannot load ImportGui')
raise
def GetIcon(self):
# returns an icon for the workbench
return ["/* XPM */\n"
"static const char *fileopen[] = {\n"
"\"16 13 5 1\",\n"
"\". c #040404\",\n"
"\"# c #808304\",\n"
"\"a c None\",\n"
"\"b c #f3f704\",\n"
"\"c c #f3f7f3\",\n"
"\"aaaaaaaaa...aaaa\",\n"
"\"aaaaaaaa.aaa.a.a\",\n"
"\"aaaaaaaaaaaaa..a\",\n"
"\"a...aaaaaaaa...a\",\n"
"\".bcb.......aaaaa\",\n"
"\".cbcbcbcbc.aaaaa\",\n"
"\".bcbcbcbcb.aaaaa\",\n"
"\".cbcb...........\",\n"
"\".bcb.#########.a\",\n"
"\".cb.#########.aa\",\n"
"\".b.#########.aaa\",\n"
"\"..#########.aaaa\",\n"
"\"...........aaaaa\"};\n"]
Gui.addWorkbench("Import",ImportWorkbench())
"""

View File

@@ -7,13 +7,13 @@ a.new{ color:#ba0000; text-decoration:none; }
padding:5px;
}
.tocindent {
margin-left: 2em;
margin-left: 2em;
}
.tocline {
margin-bottom: 0px;
margin-bottom: 0px;
}
.toctoggle, .editsection {
font-size: smaller;
font-size: smaller;
}
/* images */
@@ -126,7 +126,7 @@ p, .documentDescription {
}
.tocindent p {
margin: 0 0 0 0 ! important;
margin: 0 0 0 0 ! important;
}
pre {
@@ -135,8 +135,8 @@ pre {
font-size: 95%;
overflow: auto;
padding: 5px;
background : #F9F9F9;
color : black;
background : #F9F9F9;
color : black;
}
table.listing,
@@ -167,8 +167,8 @@ a:link, a:visited {
}
#content {
background : white;
color : black;
background : white;
color : black;
}
#column-content {
@@ -181,14 +181,14 @@ a:link, a:visited {
}
/* MSIE/Win doesn't understand 'inherit' */
/*a, a.external, a.new, a.stub {
color: black ! important;
text-decoration: none ! important;
color: black ! important;
text-decoration: none ! important;
}
*/
/* Continue ... */
/*a, a.external, a.new, a.stub {
color: inherit ! important;
text-decoration: inherit ! important;
color: inherit ! important;
text-decoration: inherit ! important;
}
*/
img { border: none; }

View File

@@ -67,89 +67,89 @@ locations = [["../Gui/Language","translation.qrc"," prefix=\"/translations\""],
["../Mod/Sketcher/Gui/Resources","Sketcher.qrc"]]
def main():
global Verbose,Automatic,ExtraDist,Dir,Output
try:
opts, args = getopt.getopt(sys.argv[1:], "hvd:o:", ["help", "verbose", "auto", "dist", "directory=","out-file="])
except getopt.GetoptError:
# print help information and exit:
sys.stderr.write(Usage)
sys.exit(2)
global Verbose,Automatic,ExtraDist,Dir,Output
try:
opts, args = getopt.getopt(sys.argv[1:], "hvd:o:", ["help", "verbose", "auto", "dist", "directory=","out-file="])
except getopt.GetoptError:
# print help information and exit:
sys.stderr.write(Usage)
sys.exit(2)
# checking on the options
for o, a in opts:
if o == "-v":
Verbose = True
if o in ("-h", "--help"):
sys.stderr.write(Usage)
sys.exit()
if o in ("-a", "--auto"):
Automatic = True
if o in ("--dist"):
ExtraDist = True
if o in ("-o", "--out-file"):
Output = a
if o in ("-d", "--directory"):
print("Using path: " + a +"\n")
Dir = a
if Automatic:
path = os.path.realpath(__file__)
path = os.path.dirname(path)
for i in locations:
qrcDir = os.path.realpath(join(path,i[0]))
if len(i) > 2:
updateResourceFile(qrcDir,i[1],i[2])
else:
updateResourceFile(qrcDir,i[1])
if ExtraDist:
makeTargetExtraDist(qrcDir)
else:
updateResourceFile(Dir, Output)
if ExtraDist:
makeTargetExtraDist(Dir)
# checking on the options
for o, a in opts:
if o == "-v":
Verbose = True
if o in ("-h", "--help"):
sys.stderr.write(Usage)
sys.exit()
if o in ("-a", "--auto"):
Automatic = True
if o in ("--dist"):
ExtraDist = True
if o in ("-o", "--out-file"):
Output = a
if o in ("-d", "--directory"):
print("Using path: " + a +"\n")
Dir = a
if Automatic:
path = os.path.realpath(__file__)
path = os.path.dirname(path)
for i in locations:
qrcDir = os.path.realpath(join(path,i[0]))
if len(i) > 2:
updateResourceFile(qrcDir,i[1],i[2])
else:
updateResourceFile(qrcDir,i[1])
if ExtraDist:
makeTargetExtraDist(qrcDir)
else:
updateResourceFile(Dir, Output)
if ExtraDist:
makeTargetExtraDist(Dir)
def updateResourceFile(Dir, Output,prefix=""):
global Verbose
Output = join(Dir,Output)
file = open(Output,"w")
file.write(hhcHeader % (prefix))
DirPath = Dir + os.path.sep
filelist=[]
for root, dirs, files in os.walk(Dir):
for name in files:
if ( (1 in [c in name for c in EndingList]) and not ('.svn' in root) ):
FilePathOrg = join(root,name)
FilePath = FilePathOrg.replace(DirPath,'')
FilePath = FilePath.replace('.\\','')
FilePath = FilePath.replace('\\','/')
if Verbose: print(FilePathOrg + ' -> ' + FilePath)
filelist.append(FilePath)
global Verbose
Output = join(Dir,Output)
file = open(Output,"w")
file.write(hhcHeader % (prefix))
DirPath = Dir + os.path.sep
filelist=[]
for root, dirs, files in os.walk(Dir):
for name in files:
if ( (1 in [c in name for c in EndingList]) and not ('.svn' in root) ):
FilePathOrg = join(root,name)
FilePath = FilePathOrg.replace(DirPath,'')
FilePath = FilePath.replace('.\\','')
FilePath = FilePath.replace('\\','/')
if Verbose: print(FilePathOrg + ' -> ' + FilePath)
filelist.append(FilePath)
filelist.sort()
for i in filelist:
file.write(' <file>' + i + '</file>\n')
filelist.sort()
for i in filelist:
file.write(' <file>' + i + '</file>\n')
file.write(hhcFooter)
file.close()
file.write(hhcFooter)
file.close()
def makeTargetExtraDist(Dir):
extensions = EndingList[:]
extensions.append(".qrc")
extensions.append(".bat")
extensions.append(".ts")
print("EXTRA_DIST = \\")
DirPath = Dir + os.path.sep
for root, dirs, files in os.walk(Dir):
for name in files:
if ( (1 in [c in name for c in extensions]) and not ('.svn' in root) ):
FilePathOrg = join(root,name)
FilePath = FilePathOrg.replace(DirPath,'')
FilePath = FilePath.replace('.\\','')
FilePath = FilePath.replace('\\','/')
print("\t\t%s \\" % (FilePath))
print()
extensions = EndingList[:]
extensions.append(".qrc")
extensions.append(".bat")
extensions.append(".ts")
print("EXTRA_DIST = \\")
DirPath = Dir + os.path.sep
for root, dirs, files in os.walk(Dir):
for name in files:
if ( (1 in [c in name for c in extensions]) and not ('.svn' in root) ):
FilePathOrg = join(root,name)
FilePath = FilePathOrg.replace(DirPath,'')
FilePath = FilePath.replace('.\\','')
FilePath = FilePath.replace('\\','/')
print("\t\t%s \\" % (FilePath))
print()
if __name__ == "__main__":
main()
main()

View File

@@ -11,59 +11,59 @@ import zipfile
# SAX handler to parse the Document.xml
class DocumentHandler(xml.sax.handler.ContentHandler):
def __init__(self, dirname):
super().__init__()
self.files = []
self.dirname = dirname
def __init__(self, dirname):
super().__init__()
self.files = []
self.dirname = dirname
def startElement(self, name, attributes):
item=attributes.get("file")
if item is not None:
self.files.append(os.path.join(self.dirname,str(item)))
def startElement(self, name, attributes):
item=attributes.get("file")
if item is not None:
self.files.append(os.path.join(self.dirname,str(item)))
def characters(self, data):
return
def characters(self, data):
return
def endElement(self, name):
return
def endElement(self, name):
return
def extractDocument(filename, outpath):
zfile=zipfile.ZipFile(filename)
files=zfile.namelist()
for i in files:
data=zfile.read(i)
dirs=i.split("/")
if len(dirs) > 1:
dirs.pop()
curpath=outpath
for j in dirs:
curpath=curpath+"/"+j
os.mkdir(curpath)
output=open(outpath+"/"+i,'wb')
output.write(data)
output.close()
zfile=zipfile.ZipFile(filename)
files=zfile.namelist()
for i in files:
data=zfile.read(i)
dirs=i.split("/")
if len(dirs) > 1:
dirs.pop()
curpath=outpath
for j in dirs:
curpath=curpath+"/"+j
os.mkdir(curpath)
output=open(outpath+"/"+i,'wb')
output.write(data)
output.close()
def createDocument(filename, outpath):
files=getFilesList(filename)
compress=zipfile.ZipFile(outpath,'w',zipfile.ZIP_DEFLATED)
for i in files:
dirs=os.path.split(i)
#print i, dirs[-1]
compress.write(i,dirs[-1],zipfile.ZIP_DEFLATED)
compress.close()
files=getFilesList(filename)
compress=zipfile.ZipFile(outpath,'w',zipfile.ZIP_DEFLATED)
for i in files:
dirs=os.path.split(i)
#print i, dirs[-1]
compress.write(i,dirs[-1],zipfile.ZIP_DEFLATED)
compress.close()
def getFilesList(filename):
dirname=os.path.dirname(filename)
handler=DocumentHandler(dirname)
parser=xml.sax.make_parser()
parser.setContentHandler(handler)
parser.parse(filename)
dirname=os.path.dirname(filename)
handler=DocumentHandler(dirname)
parser=xml.sax.make_parser()
parser.setContentHandler(handler)
parser.parse(filename)
files=[]
files.append(filename)
files.extend(iter(handler.files))
dirname=os.path.join(dirname,"GuiDocument.xml")
if os.path.exists(dirname):
files.append(dirname)
return files
files=[]
files.append(filename)
files.extend(iter(handler.files))
dirname=os.path.join(dirname,"GuiDocument.xml")
if os.path.exists(dirname):
files.append(dirname)
return files

View File

@@ -37,28 +37,28 @@ def Process(line):
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:o:", ["help", "verbose", "in-file=","out-file="])
except getopt.GetoptError:
# print help information and exit:
sys.stderr.write(Usage)
sys.exit(2)
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:o:", ["help", "verbose", "in-file=","out-file="])
except getopt.GetoptError:
# print help information and exit:
sys.stderr.write(Usage)
sys.exit(2)
# checking on the options
for o, a in opts:
if o in ("-h", "--help"):
sys.stderr.write(Usage)
sys.exit()
if o in ("-o", "--out-file"):
outfile = open(a,'w')
if o in ("-i", "--in-file"):
infile = open(a,'r')
# checking on the options
for o, a in opts:
if o in ("-h", "--help"):
sys.stderr.write(Usage)
sys.exit()
if o in ("-o", "--out-file"):
outfile = open(a,'w')
if o in ("-i", "--in-file"):
infile = open(a,'r')
lines = infile.readlines()
for l in lines:
outfile.write(Process(l))
#print l
lines = infile.readlines()
for l in lines:
outfile.write(Process(l))
#print l
if __name__ == "__main__":
main()
main()

View File

@@ -25,37 +25,37 @@ For help on the modules type:
"""
if(len(sys.argv) < 2):
sys.stdout.write(help1)
sys.stdout.write("Insert command: ")
sys.stdout.flush()
CmdRaw = sys.stdin.readline()[:-1]
sys.stdout.write(help1)
sys.stdout.write("Insert command: ")
sys.stdout.flush()
CmdRaw = sys.stdin.readline()[:-1]
else:
CmdRaw = sys.argv[1]
CmdRaw = sys.argv[1]
Cmd = CmdRaw.lower()
if Cmd == "distsrc" or Cmd == "ds" :
import fcbt.DistSrc
import fcbt.DistSrc
elif Cmd == "distbin" or Cmd == "db":
import fcbt.DistBin
import fcbt.DistBin
elif Cmd == "distsetup" or Cmd == "di":
import fcbt.DistSetup
import fcbt.DistSetup
elif Cmd == "distsetup" or Cmd == "dui":
import fcbt.DistUserSetup
import fcbt.DistUserSetup
elif Cmd == "distall" or Cmd == "da":
import fcbt.DistSrc
import fcbt.DistBin
import fcbt.DistSetup
import fcbt.DistSrc
import fcbt.DistBin
import fcbt.DistSetup
elif Cmd == "nextbuildnumber" or Cmd == "nbn":
import fcbt.NextBuildNumber
import fcbt.NextBuildNumber
elif Cmd == "createmodule" or Cmd == "cm":
import fcbt.CreateModule
import fcbt.CreateModule
elif Cmd == "createpymodule" or Cmd == "cp":
import fcbt.CreatePyModule
import fcbt.CreatePyModule
elif Cmd == "?" or Cmd == "help" or Cmd == "/h" or Cmd == "/?" or Cmd == "-h" or Cmd == "-help":
sys.stdout.write(help1)
sys.stdout.write(help1)
else:
print(CmdRaw + " is an unknown command!\n")
sys.exit(1)
print(CmdRaw + " is an unknown command!\n")
sys.exit(1)

View File

@@ -72,47 +72,47 @@ def SetupFilter(MatchList):
def createApp(Application):
"""
Create a new application by copying the template
"""
# create directory ../Mod/<Application>
if not os.path.isdir("../Mod/"+Application):
os.mkdir("../Mod/"+Application)
else:
sys.stdout.write(Application + " already exists. Please enter another name.\n")
sys.exit()
"""
Create a new application by copying the template
"""
# create directory ../Mod/<Application>
if not os.path.isdir("../Mod/"+Application):
os.mkdir("../Mod/"+Application)
else:
sys.stdout.write(Application + " already exists. Please enter another name.\n")
sys.exit()
# copying files from _TEMPLATE_ to ../Mod/<Application>
sys.stdout.write("Copying files...")
MakeAppTools.copyTemplate("_TEMPLATE_","../Mod/"+Application,"_TEMPLATE_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
sys.stdout.write("Ok\n")
# copying files from _TEMPLATE_ to ../Mod/<Application>
sys.stdout.write("Copying files...")
MakeAppTools.copyTemplate("_TEMPLATE_","../Mod/"+Application,"_TEMPLATE_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
sys.stdout.write("Ok\n")
# replace the _TEMPLATE_ string by <Application>
sys.stdout.write("Modifying files...\n")
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATE_",Application)
MakeAppTools.replaceTemplate("../Mod/" + Application,"${CMAKE_SOURCE_DIR}/src/Tools/","${CMAKE_SOURCE_DIR}/src/Mod/")
# make the configure script executable
#os.chmod("../Mod/" + Application + "/configure", 0777);
sys.stdout.write("Modifying files done.\n")
# replace the _TEMPLATE_ string by <Application>
sys.stdout.write("Modifying files...\n")
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATE_",Application)
MakeAppTools.replaceTemplate("../Mod/" + Application,"${CMAKE_SOURCE_DIR}/src/Tools/","${CMAKE_SOURCE_DIR}/src/Mod/")
# make the configure script executable
#os.chmod("../Mod/" + Application + "/configure", 0777);
sys.stdout.write("Modifying files done.\n")
sys.stdout.write(Application + " module created successfully.\n")
sys.stdout.write(Application + " module created successfully.\n")
def validateApp(AppName):
"""
Validates the class name
"""
if(len(AppName) < 2):
sys.stdout.write("Too short name: '"+AppName+"'\n")
sys.exit()
# name is long enough
clName="class "+AppName+": self=0"
try:
exec(clName)
except Exception:
# Invalid class name
sys.stdout.write("Invalid name: '"+AppName+"'\n")
sys.exit()
"""
Validates the class name
"""
if(len(AppName) < 2):
sys.stdout.write("Too short name: '"+AppName+"'\n")
sys.exit()
# name is long enough
clName="class "+AppName+": self=0"
try:
exec(clName)
except Exception:
# Invalid class name
sys.stdout.write("Invalid name: '"+AppName+"'\n")
sys.exit()
sys.stdout.write("Please enter a name for your application:")
sys.stdout.flush()

View File

@@ -23,7 +23,7 @@ Generate source code out of an model definition.
Author:
(c) 2006 Juergen Riegel
juergen.riegel@web.de
Licence: GPL
Licence: GPL
Version:
0.2

View File

@@ -22,20 +22,20 @@ def temporary_exec(text, globals, locals):
def ensureDir(path,mode=0o777):
try:
os.makedirs(path,mode)
except OSError as err:
# https://docs.python.org/3/tutorial/errors.html
# raise an error unless it's about an already existing directory
print("Dir Exist")
#if errno != 17 or not os.path.isdir(path):
# raise
try:
os.makedirs(path,mode)
except OSError as err:
# https://docs.python.org/3/tutorial/errors.html
# raise an error unless it's about an already existing directory
print("Dir Exist")
#if errno != 17 or not os.path.isdir(path):
# raise
def convertMultilineString(str):
str = str.replace('\n','\\n')
str = str.replace('"','\\"')
return str
str = str.replace('\n','\\n')
str = str.replace('"','\\"')
return str
"Yet Another Python Templating Utility, Version 1.2"
import sys

View File

@@ -9,33 +9,33 @@ import generateBase.generateModel_Module
import generateBase.generateTools
class TemplateClassPyExport (template.ModelTemplate):
def Generate(self):
#self.ParentNamespace = "Base"
#self.Namespace = "Base"
encoding = sys.getfilesystemencoding()
path = self.path
if hasattr(path,"decode"): # this is python2. Otherwise this is unicode already
path = path.decode(encoding)
exportName = self.export.Name
if hasattr(exportName,"decode"): # this is python2. Otherwise this is unicode already
exportName = exportName.decode(encoding)
dirname = self.dirname
if hasattr(dirname,"decode"): # this is python2. Otherwise this is unicode already
dirname = dirname.decode(encoding)
print("TemplateClassPyExport",path + exportName)
# Imp.cpp must not exist, neither in path nor in dirname
if(not os.path.exists(path + exportName + "Imp.cpp")):
if(not os.path.exists(dirname + exportName + "Imp.cpp")):
file = open(path + exportName + "Imp.cpp",'wb')
generateBase.generateTools.replace(self.TemplateImplement,locals(),file)
file.close()
with open(path + exportName + ".cpp", 'wb') as file:
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
with open(path + exportName + ".h", 'wb') as file:
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
def Generate(self):
#self.ParentNamespace = "Base"
#self.Namespace = "Base"
encoding = sys.getfilesystemencoding()
path = self.path
if hasattr(path,"decode"): # this is python2. Otherwise this is unicode already
path = path.decode(encoding)
exportName = self.export.Name
if hasattr(exportName,"decode"): # this is python2. Otherwise this is unicode already
exportName = exportName.decode(encoding)
dirname = self.dirname
if hasattr(dirname,"decode"): # this is python2. Otherwise this is unicode already
dirname = dirname.decode(encoding)
print("TemplateClassPyExport",path + exportName)
# Imp.cpp must not exist, neither in path nor in dirname
if(not os.path.exists(path + exportName + "Imp.cpp")):
if(not os.path.exists(dirname + exportName + "Imp.cpp")):
file = open(path + exportName + "Imp.cpp",'wb')
generateBase.generateTools.replace(self.TemplateImplement,locals(),file)
file.close()
with open(path + exportName + ".cpp", 'wb') as file:
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
with open(path + exportName + ".h", 'wb') as file:
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
TemplateHeader = """
TemplateHeader = """
// This file is generated by src/Tools/generateTemplates/templateClassPyExport.py out of the XML file
// Every change you make here gets lost in the next full rebuild!
#ifndef @self.export.Namespace.upper().replace("::", "_")@_@self.export.Name.upper()@_H
@@ -252,7 +252,7 @@ public:
"""
TemplateModule = """
TemplateModule = """
// This file is generated by src/Tools/generateTemplates/templateClassPyExport.py out of the .XML file
// Every change you make here gets lost in the next full rebuild!
// This File is normally built as an include in @self.export.Name@Imp.cpp! It's not intended to be in a project!
@@ -1136,8 +1136,8 @@ int @self.export.Name@::setCustomAttributes(const char* /*attr*/, PyObject* /*ob
"""
# Here's the template for the user part of the implementation. This does NOT get overridden if it already exists.
TemplateImplement = """
# Here's the template for the user part of the implementation. This does NOT get overridden if it already exists.
TemplateImplement = """
#include "PreCompiled.h"
#include "@self.export.Include@"

View File

@@ -7,23 +7,23 @@ import generateBase.generateModel_Module
import generateBase.generateTools
class TemplateModuleApp (template.ModelTemplate):
def Generate(self):
AppPath = self.path + "/App/"
generateBase.generateTools.ensureDir(AppPath)
# the main module files
AppMain= templateModuleAppMain.TemplateModuleAppMain()
AppMain.path = AppPath
AppMain.module = self.module
AppMain.Generate()
# Features
generateBase.generateTools.ensureDir(AppPath + "Features/")
for i in self.module.Content.Feature:
AppFeature = templateModuleAppFeature.TemplateFeature()
AppFeature.path = AppPath + "Features/"
AppFeature.module = self.module
AppFeature.feature = i
AppFeature.Generate()
def Generate(self):
AppPath = self.path + "/App/"
generateBase.generateTools.ensureDir(AppPath)
# the main module files
AppMain= templateModuleAppMain.TemplateModuleAppMain()
AppMain.path = AppPath
AppMain.module = self.module
AppMain.Generate()
# Features
generateBase.generateTools.ensureDir(AppPath + "Features/")
for i in self.module.Content.Feature:
AppFeature = templateModuleAppFeature.TemplateFeature()
AppFeature.path = AppPath + "Features/"
AppFeature.module = self.module
AppFeature.feature = i
AppFeature.Generate()

View File

@@ -7,16 +7,16 @@ import generateBase.generateModel_Module
import generateBase.generateTools
class TemplateFeature (template.ModelTemplate):
def Generate(self):
file = open(self.path + self.feature.Name + "Imp.cpp",'w')
generateBase.generateTools.replace(self.TemplateImplement,locals(),file)
file = open(self.path + self.feature.Name + ".cpp",'w')
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
file = open(self.path + self.feature.Name + ".h",'w')
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
def Generate(self):
file = open(self.path + self.feature.Name + "Imp.cpp",'w')
generateBase.generateTools.replace(self.TemplateImplement,locals(),file)
file = open(self.path + self.feature.Name + ".cpp",'w')
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
file = open(self.path + self.feature.Name + ".h",'w')
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
TemplateHeader = """
TemplateHeader = """
#ifndef @self.module.Name.upper()@_FEATURE_@self.feature.Name.upper()@_H
#define @self.module.Name.upper()@_FEATURE_@self.feature.Name.upper()@_H
@@ -54,7 +54,7 @@ public:
#endif // @self.module.Name.upper()@_FEATURE_@self.feature.Name.upper()@_H
"""
TemplateModule = """
TemplateModule = """
#include "PreCompiled.h"
#include "@self.feature.Name@.h"
@@ -70,8 +70,8 @@ PROPERTY_SOURCE(@self.module.Name@::@self.feature.Name@, App::Feature)
-
}
"""
# Here's the template for the user part of the implementation. This does NOT get overwritten if it already exists.
TemplateImplement = """
# Here's the template for the user part of the implementation. This does NOT get overwritten if it already exists.
TemplateImplement = """
//
#include "PreCompiled.h"

View File

@@ -7,12 +7,12 @@ import generateBase.generateModel_Module
import generateBase.generateTools
class TemplateModuleAppMain (template.ModelTemplate):
def Generate(self):
file = open(self.path + "/App" + self.module.Name + ".cpp",'w')
generateBase.generateTools.replace(self.Template,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
def Generate(self):
file = open(self.path + "/App" + self.module.Name + ".cpp",'w')
generateBase.generateTools.replace(self.Template,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
Template = """
Template = """
/***************************************************************************
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
@@ -46,7 +46,7 @@ void App@self.module.Name@Export init@self.module.Name@() {
@self.module.Name@::Feature@i.Name@::init();
-
return;
return;
}
} // extern "C"

View File

@@ -6,83 +6,83 @@
import pydoc, pkgutil, sys, os, dircache, zipfile
def generateDoc():
# Get the path to the FreeCAD module relative to this directory
toolspath = os.path.dirname(__file__)
homepath = toolspath + '/../../'
homepath = os.path.realpath(homepath)
binpath = os.path.join(homepath, 'bin')
docpath = os.path.join(homepath, 'doc')
modpath = os.path.join(homepath, 'Mod')
# Get the path to the FreeCAD module relative to this directory
toolspath = os.path.dirname(__file__)
homepath = toolspath + '/../../'
homepath = os.path.realpath(homepath)
binpath = os.path.join(homepath, 'bin')
docpath = os.path.join(homepath, 'doc')
modpath = os.path.join(homepath, 'Mod')
# Change to the doc directory
cwd = os.getcwd()
print('Change to ' + docpath)
os.chdir(homepath)
if os.path.exists('doc') == False:
os.mkdir('doc')
os.chdir('doc')
# Change to the doc directory
cwd = os.getcwd()
print('Change to ' + docpath)
os.chdir(homepath)
if os.path.exists('doc') == False:
os.mkdir('doc')
os.chdir('doc')
# Add the bin path to the system path
if os.name == 'nt':
os.environ['PATH'] = os.environ['PATH'] + ';' + binpath
else:
os.environ['PATH'] = os.environ['PATH'] + ':' + binpath
# Add the bin path to the system path
if os.name == 'nt':
os.environ['PATH'] = os.environ['PATH'] + ';' + binpath
else:
os.environ['PATH'] = os.environ['PATH'] + ':' + binpath
# Import FreeCAD module
sys.path.append(binpath)
print('Write documentation for module \'FreeCAD\'')
pydoc.writedoc('FreeCAD')
print('')
# Import FreeCAD module
sys.path.append(binpath)
print('Write documentation for module \'FreeCAD\'')
pydoc.writedoc('FreeCAD')
print('')
# Module directory
ModDirs = dircache.listdir(modpath)
# Module directory
ModDirs = dircache.listdir(modpath)
# Search for module paths and append them to Python path
#for Dir in ModDirs:
# if (Dir != '__init__.py'):
# sys.path.append( os.path.join(modpath,Dir) )
# Search for module paths and append them to Python path
#for Dir in ModDirs:
# if (Dir != '__init__.py'):
# sys.path.append( os.path.join(modpath,Dir) )
# Walk through the module paths again and try loading the modules to create HTML files
for Dir in ModDirs:
dest = os.path.join(modpath,Dir)
print('Write documentation for module \'' + Dir + '\'')
if (Dir != '__init__.py'):
writedocs(dest)
print('')
# Walk through the module paths again and try loading the modules to create HTML files
for Dir in ModDirs:
dest = os.path.join(modpath,Dir)
print('Write documentation for module \'' + Dir + '\'')
if (Dir != '__init__.py'):
writedocs(dest)
print('')
# Now we must create a document and create instances of all Python classes which
# cannot be directly created by a module.
# Now we must create a document and create instances of all Python classes which
# cannot be directly created by a module.
# Create a ZIP archive from all HTML files
print('Creating ZIP archive \'docs.zip\'...')
zip = zipfile.ZipFile('docs.zip', 'w')
for file in os.listdir('.'):
if not os.path.isdir(file):
if file.find('.html') > 0:
print(' Adding file ' + file + ' to archive')
zip.write(file)
# Create a ZIP archive from all HTML files
print('Creating ZIP archive \'docs.zip\'...')
zip = zipfile.ZipFile('docs.zip', 'w')
for file in os.listdir('.'):
if not os.path.isdir(file):
if file.find('.html') > 0:
print(' Adding file ' + file + ' to archive')
zip.write(file)
print('done.')
zip.close()
print('done.')
zip.close()
# Remove all HTML files
print('Cleaning up HTML files...')
for file in os.listdir('.'):
if not os.path.isdir(file):
if file.find('.html') > 0:
print(' Removing ' + file)
os.remove(file)
# Remove all HTML files
print('Cleaning up HTML files...')
for file in os.listdir('.'):
if not os.path.isdir(file):
if file.find('.html') > 0:
print(' Removing ' + file)
os.remove(file)
os.chdir(cwd)
print('done.')
os.chdir(cwd)
print('done.')
def writedocs(dir, pkgpath=''):
"""Write out HTML documentation for all modules in a directory tree."""
for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath):
# Ignore all debug modules
if modname[-2:] != '_d':
pydoc.writedoc(modname)
# Ignore all debug modules
if modname[-2:] != '_d':
pydoc.writedoc(modname)
return
if __name__ == "__main__":
generateDoc()
generateDoc()