-##
-# Generates a launcher that sources Salome's python and calls original launcher
-def generate_sourcing_launcher(config, appli_dir, logger) :
-
- # Rename original launcher
- launcher_name = os.path.join( appli_dir,
- "bin",
- "salome",
- config.APPLI.launch_alias_name )
- original_launcher = launcher_name + "-original"
- os.rename( launcher_name, original_launcher )
-
- # Open new launcher
- f = open(launcher_name, "w")
-
- # Write the set up of the environment
- env = src.environment.SalomeEnviron( config,
- src.fileEnviron.get_file_environ(
- f,
- "bash",
- {},
- config))
- env.set_a_product( "Python", logger)
-
- # Write the call to the original launcher
- f.write( "\n\n")
- f.write( "# This is the call to the original launcher\n")
- f.write( original_launcher + " $*" )
- f.write( "\n\n")
-
- # Write the cleaning of the environment
- env.finish(True)
-
- # Close new launcher
- f.close()
- os.chmod(launcher_name, stat.S_IRWXU| stat.S_IRWXG| stat.S_IRWXO) # 0777
-
-