Salome HOME
improve the load of environment for the APPLICATION.environ section
authorCEA Support SALOME <support-salome@cea.fr>
Tue, 7 Mar 2017 14:41:19 +0000 (15:41 +0100)
committerCEA Support SALOME <support-salome@cea.fr>
Tue, 7 Mar 2017 14:41:19 +0000 (15:41 +0100)
src/environment.py

index e66cabc795014638076b23bcc0a14cb68b2e1dae..29c8edb1e3f1987cd4979baf54a81246a39e42d1 100644 (file)
@@ -336,23 +336,11 @@ class SalomeEnviron:
         # Set the variables defined in the "environ" section
         if 'environ' in self.cfg.APPLICATION:
             self.add_comment("APPLICATION environment")
-            for p in self.cfg.APPLICATION.environ:
-                val = self.cfg.APPLICATION.environ[p]
-                # "_" means that the value must be prepended
-                if p.startswith("_"):
-                    # separator exception for PV_PLUGIN_PATH
-                    if p[1:] == 'PV_PLUGIN_PATH':
-                        self.prepend(p[1:], val, ';')
-                    else:
-                        self.prepend(p[1:], val)
-                elif p.endswith("_"):
-                    # separator exception for PV_PLUGIN_PATH
-                    if p[:-1] == 'PV_PLUGIN_PATH':
-                        self.append(p[:-1], val, ';')
-                    else:
-                        self.append(p[:-1], val)
-                else:
-                    self.set(p, val)
+            self.load_cfg_environment(self.cfg.APPLICATION.environ)
+            if self.forBuild and "build" in self.cfg.APPLICATION.environ:
+                self.load_cfg_environment(self.cfg.APPLICATION.environ.build)
+            if not self.forBuild and "launch" in pi.environ:
+                self.load_cfg_environment(self.cfg.APPLICATION.environ.launch)
             self.add_line(1)
 
         # If there is an "environ_script" section, load the scripts
@@ -830,4 +818,4 @@ def load_environment(config, build, logger):
     environ = SalomeEnviron(config, Environ(os.environ), build)
     environ.set_application_env(logger)
     environ.set_products(logger)
-    environ.finish(True)
\ No newline at end of file
+    environ.finish(True)