1
# FreeCAD MakeNewBuildNbr script
2
# (c) 2003 Werner Mayer
4
# Create a new application
6
#***************************************************************************
7
#* (c) Werner Mayer (werner.wm.mayer@gmx.de) 2003 *
9
#* This file is part of the FreeCAD CAx development system. *
11
#* This program is free software; you can redistribute it and/or modify *
12
#* it under the terms of the GNU General Public License (GPL) *
13
#* as published by the Free Software Foundation; either version 2 of *
14
#* the License, or (at your option) any later version. *
15
#* for detail see the LICENCE text file. *
17
#* FreeCAD is distributed in the hope that it will be useful, *
18
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
19
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20
#* GNU Library General Public License for more details. *
22
#* You should have received a copy of the GNU Library General Public *
23
#* License along with FreeCAD; if not, write to the Free Software *
24
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
27
#* Werner Mayer 2003 *
28
#***************************************************************************
35
if(len(sys.argv) != 2):
36
sys.stdout.write("Please enter a name for your application.\n")
39
Application = sys.argv[1]
41
# create directory ../Mod/<Application>
42
if not os.path.isdir("../Mod/"+Application):
43
os.mkdir("../Mod/"+Application)
45
sys.stdout.write(Application + " already exists. Please enter another name.\n")
49
# copying files from _TEMPLATE_ to ../Mod/<Application>
50
sys.stdout.write("Copying files...")
51
MakeAppTools.copyTemplate("_TEMPLATE_","../Mod/"+Application,"_TEMPLATE_", Application)
52
sys.stdout.write("Ok\n")
54
# replace the _TEMPLATE_ string by <Application>
55
sys.stdout.write("Modifying files...\n")
56
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATE_",Application)
57
# make the congigure script executable
58
#os.chmod("../Mod/" + Application + "/configure", 0777);
59
sys.stdout.write("Modifying files done.\n")
61
sys.stdout.write(Application + " module created successfully.\n")