]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Adding PATH and PYTHONPATH of workdirectory in job environnement
authorribes <ribes>
Wed, 20 Jan 2010 14:06:42 +0000 (14:06 +0000)
committerribes <ribes>
Wed, 20 Jan 2010 14:06:42 +0000 (14:06 +0000)
src/Launcher/Launcher_Job_Command.cxx
src/Launcher/Launcher_Job_SALOME.cxx

index 313a0b02655c4e66846effa1c43d940c1511c6b3..fa33a2363d1d535b7d0d2cd2b9dd277c02277569 100644 (file)
@@ -42,8 +42,6 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l
   std::string work_directory = params[WORKDIR].str();
 
   // File name
-  std::string::size_type p1 = _job_file.find_last_of("/");
-  
   std::string launch_date_port_file = launch_date;
   std::string launch_script = "/tmp/runCommand_" + _job_file_name + "_" + launch_date + ".sh";
   std::ofstream launch_script_stream;
@@ -52,6 +50,8 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l
   // Script
   launch_script_stream << "#! /bin/sh -f" << std::endl;
   launch_script_stream << "cd " << work_directory << std::endl;
+  launch_script_stream << "export PYTHONPATH=" << work_directory << ":$PYTHONPATH" << std::endl;
+  launch_script_stream << "export PATH=" << work_directory << ":$PATH" << std::endl;
   if (_env_file != "")
   {
     std::string::size_type last = _env_file.find_last_of("/");
index 84ab93569e874d09c0f0e8c335bb39bd23e2cea7..0555a38072d0bb6f7617156bb47d409d2e2d2bbd 100644 (file)
@@ -61,6 +61,8 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params)
   // Begin of script
   launch_script_stream << "#! /bin/sh -f" << std::endl;
   launch_script_stream << "cd " << work_directory << std::endl;
+  launch_script_stream << "export PYTHONPATH=" << work_directory << ":$PYTHONPATH" << std::endl;
+  launch_script_stream << "export PATH=" << work_directory << ":$PATH" << std::endl;
   if (_env_file != "")
   {
     std::string::size_type last = _env_file.find_last_of("/");