From: Camille GOUTTEBROZE Date: Tue, 16 Sep 2014 10:12:04 +0000 (+0200) Subject: Revert "Rename bin/app-quickstart.py -> bin/profile-quickstart.py" X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=86ea921ce6cf217879ed41f544a5a33de986e46c;p=modules%2Fkernel.git Revert "Rename bin/app-quickstart.py -> bin/profile-quickstart.py" This reverts commit b328c859a88b643fb099feb82146b10517480cbc. --- diff --git a/bin/app-quickstart.py b/bin/app-quickstart.py new file mode 100755 index 000000000..dce0224bb --- /dev/null +++ b/bin/app-quickstart.py @@ -0,0 +1,89 @@ +#! /usr/bin/env python +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import os +import shutil +import optparse + +# Options of this script +def ProfileQuickStartParser() : + + parser = optparse.OptionParser( usage = "usage: python app-quickstart.py [options]" ) + + parser.add_option('-p', + "--prefix", + metavar="", + type="string", + action="store", + dest="prefix", + default='.', + help="Where the application's sources will be generated") + + parser.add_option('-m', + "--modules", + metavar="", + type="string", + action="append", + dest="modules", + default='KERNEL,GUI', + help="List of the application's modules") + + parser.add_option('-n', + "--name", + type="string", + action="store", + dest="name", + default='PROFILE', + help="Name of the profile") + + parser.add_option('-f', + "--force", + action="store_true", + dest="force", + help="Overwrites existing sources") + + return parser + + +#Generation of a template profile sources +def generate_sources( options, args ) : + + #Name of the profile sources + source_dir = os.path.join( options.prefix, options.name ) + + #Check if the directory of the sources already exists + if os.path.exists( source_dir ) and not options.force : + print "Directory %s already exsits." %source_dir + print "Use option --force to overwrite it." + return + + # Create directory + if os.path.exists( source_dir ) : + shutil.rmtree( source_dir ) + os.makedirs( source_dir ) + +# ----------------------------------------------------------------------------- + +if __name__ == '__main__': + + (options, args) = ProfileQuickStartParser().parse_args() + + generate_sources( options, args ) diff --git a/bin/profile-quickstart.py b/bin/profile-quickstart.py deleted file mode 100755 index dce0224bb..000000000 --- a/bin/profile-quickstart.py +++ /dev/null @@ -1,89 +0,0 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -import os -import shutil -import optparse - -# Options of this script -def ProfileQuickStartParser() : - - parser = optparse.OptionParser( usage = "usage: python app-quickstart.py [options]" ) - - parser.add_option('-p', - "--prefix", - metavar="", - type="string", - action="store", - dest="prefix", - default='.', - help="Where the application's sources will be generated") - - parser.add_option('-m', - "--modules", - metavar="", - type="string", - action="append", - dest="modules", - default='KERNEL,GUI', - help="List of the application's modules") - - parser.add_option('-n', - "--name", - type="string", - action="store", - dest="name", - default='PROFILE', - help="Name of the profile") - - parser.add_option('-f', - "--force", - action="store_true", - dest="force", - help="Overwrites existing sources") - - return parser - - -#Generation of a template profile sources -def generate_sources( options, args ) : - - #Name of the profile sources - source_dir = os.path.join( options.prefix, options.name ) - - #Check if the directory of the sources already exists - if os.path.exists( source_dir ) and not options.force : - print "Directory %s already exsits." %source_dir - print "Use option --force to overwrite it." - return - - # Create directory - if os.path.exists( source_dir ) : - shutil.rmtree( source_dir ) - os.makedirs( source_dir ) - -# ----------------------------------------------------------------------------- - -if __name__ == '__main__': - - (options, args) = ProfileQuickStartParser().parse_args() - - generate_sources( options, args )