~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Tools/MakeApp.py

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# FreeCAD MakeNewBuildNbr script
 
2
# (c) 2003 Werner Mayer
 
3
#
 
4
# Create a new application
 
5
 
 
6
#***************************************************************************
 
7
#*   (c) Werner Mayer (werner.wm.mayer@gmx.de) 2003                        *
 
8
#*                                                                         *
 
9
#*   This file is part of the FreeCAD CAx development system.              *
 
10
#*                                                                         *
 
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.                                 *
 
16
#*                                                                         *
 
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.                  *
 
21
#*                                                                         *
 
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  *
 
25
#*   USA                                                                   *
 
26
#*                                                                         *
 
27
#*   Werner Mayer 2003                                                     *
 
28
#***************************************************************************
 
29
 
 
30
import os,sys,string
 
31
import FCFileTools
 
32
import MakeAppTools
 
33
 
 
34
 
 
35
if(len(sys.argv) != 2):
 
36
        sys.stdout.write("Please enter a name for your application.\n")
 
37
        sys.exit()
 
38
 
 
39
Application = sys.argv[1]
 
40
 
 
41
# create directory ../Mod/<Application>
 
42
if not os.path.isdir("../Mod/"+Application):
 
43
    os.mkdir("../Mod/"+Application)
 
44
else:
 
45
        sys.stdout.write(Application + " already exists. Please enter another name.\n")
 
46
        sys.exit()
 
47
 
 
48
 
 
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") 
 
53
 
 
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")
 
60
 
 
61
sys.stdout.write(Application + " module created successfully.\n")