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( '<Name_of_Application>', 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( '<Name_of_Application>', options.name )
+ l = l.replace( '(name_of_application)', options.name.lower()
+ fout.write( l )
#Generation of a template profile sources
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" )
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 )
# -----------------------------------------------------------------------------