Salome HOME
be able to prepend an env value from APPLICATION.environ
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 17 Oct 2016 14:09:56 +0000 (16:09 +0200)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 17 Oct 2016 14:09:56 +0000 (16:09 +0200)
src/environment.py

index 2d2a83588f0c00fd62064c20c3515f16ed8e55b4..d295a5abfacc839cd5c0c7fbe77545c27e854189 100644 (file)
@@ -331,7 +331,22 @@ class SalomeEnviron:
         if 'environ' in self.cfg.APPLICATION:
             self.add_comment("APPLICATION environment")
             for p in self.cfg.APPLICATION.environ:
-                self.set(p, self.cfg.APPLICATION.environ[p])
+                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.add_line(1)
 
         # If there is an "environ_script" section, load the scripts