Fix trailing whitespace, typos, headers

Fix trailing whitespace, typos, and header uniformity.
This commit is contained in:
luzpaz
2023-01-22 17:57:12 +00:00
committed by Uwe
parent d6cccf2f96
commit 729685316e
48 changed files with 180 additions and 189 deletions

View File

@@ -1,10 +1,5 @@
# FreeCAD MakeNewBuildNbr script
# (c) 2003 Werner Mayer
#
# Creates a new application
#***************************************************************************
#* (c) Werner Mayer (werner.wm.mayer@gmx.de) 2003 *
#* Copyright (c) 2003 Werner Mayer <werner.wm.mayer@gmx.de> *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
@@ -24,9 +19,11 @@
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Werner Mayer 2003 *
#***************************************************************************
# FreeCAD MakeNewBuildNbr script
# Creates a new application
import os,sys
import MakeAppTools
import re
@@ -72,47 +69,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 _TEMPLATEPY_ to ../Mod/<Application>
sys.stdout.write("Copying files...")
MakeAppTools.copyTemplate("_TEMPLATEPY_","../Mod/"+Application,"_TEMPLATEPY_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
sys.stdout.write("Ok\n")
# copying files from _TEMPLATEPY_ to ../Mod/<Application>
sys.stdout.write("Copying files...")
MakeAppTools.copyTemplate("_TEMPLATEPY_","../Mod/"+Application,"_TEMPLATEPY_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
sys.stdout.write("Ok\n")
# replace the _TEMPLATEPY_ string by <Application>
sys.stdout.write("Modifying files...\n")
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATEPY_",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 _TEMPLATEPY_ string by <Application>
sys.stdout.write("Modifying files...\n")
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATEPY_",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()