From c52538c4d87b41042e561184368c241280439f4e Mon Sep 17 00:00:00 2001 From: Camille GOUTTEBROZE Date: Mon, 29 Sep 2014 12:09:07 +0200 Subject: [PATCH] Fix copy of files for bin/app-template/doc --- bin/app-quickstart.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/app-quickstart.py b/bin/app-quickstart.py index ab61a3097..8dd7d696e 100755 --- a/bin/app-quickstart.py +++ b/bin/app-quickstart.py @@ -67,10 +67,11 @@ def profileReplaceStrings( src, dst, options ) : with open( dst, "wt" ) as fout: with open( src, "rt" ) as fin: for line in fin: - fout.write( line.replace( '[LIST_OF_MODULES]', options.modules )/ - .replace( '[NAME_OF_APPLICATION]', options.name.upper() )/ - .replace( '', options.name )/ - .replace( '(name_of_application)', options.name.lower() ) ) + l = line.replace( '[LIST_OF_MODULES]', options.modules ) + l = l.replace( '[NAME_OF_APPLICATION]', options.name.upper() + l = l.replace( '', options.name ) + l = l.replace( '(name_of_application)', options.name.lower() + fout.write( l ) #Generation of a template profile sources def profileGenerateSources( options, args ) : @@ -78,7 +79,6 @@ def profileGenerateSources( options, args ) : #Set name of several directories app_dir = os.path.join( options.prefix, options.name ) src_dir = os.path.join( app_dir, "src" ) - resources_dir = os.path.join( app_dir, "resources" ) kernek_root_dir = os.environ["KERNEL_ROOT_DIR"] bin_dir = os.path.join( kernek_root_dir, "bin", "salome" ) template_dir = os.path.join( bin_dir, "app-template" ) @@ -100,9 +100,11 @@ def profileGenerateSources( options, args ) : shutil.copy( os.path.join( bin_dir, f ), src_dir ) #Adapt source directory - profileReplaceStrings( os.path.join( template_dir, "resources", "SalomeApp.xml.in" ), os.path.join( resources_dir, "SalomeApp.xml.in" ), options ) - profileReplaceStrings( os.path.join( template_dir, "resources", "CMakeLists.txt" ), os.path.join( resources_dir, "CMakeLists.txt" ), options ) + profileReplaceStrings( os.path.join( template_dir, "resources", "SalomeApp.xml.in" ), os.path.join( os.path.join( app_dir, "resources" ), "SalomeApp.xml.in" ), options ) + profileReplaceStrings( os.path.join( template_dir, "resources", "CMakeLists.txt" ), os.path.join( os.path.join( app_dir, "resources" ), "CMakeLists.txt" ), options ) profileReplaceStrings( os.path.join( template_dir, "CMakeLists.txt" ), os.path.join( app_dir, "CMakeLists.txt" ), options ) + profileReplaceStrings( os.path.join( template_dir, "doc", "index.rst" ), os.path.join( os.path.join( app_dir, "doc" ), "index.rst" ), options ) + profileReplaceStrings( os.path.join( template_dir, "doc", "conf.py.in" ), os.path.join( os.path.join( app_dir, "doc" ), "conf.py.in" ), options ) # ----------------------------------------------------------------------------- -- 2.39.2