]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
add appenPath to python2 template
authorcrouzet <nicolas.crouzet@cea.fr>
Wed, 16 Oct 2019 14:50:38 +0000 (16:50 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Wed, 16 Oct 2019 14:50:38 +0000 (16:50 +0200)
src/fileEnviron.py

index 3c173e26ef8a9556e46732fcfde610e4f39a205d..aa89e0dfd0bbe28c7b7395c2297431e0e42f2ef6 100644 (file)
@@ -906,6 +906,18 @@ launcher_tail_py2="""\
     logging.getLogger("salome").error(e)
     sys.exit(1)
 #
+# salomeContext only prepend variables, we use our own appendPath when required
+def appendPath(name, value, separator=os.pathsep):
+    if value == '':
+      return
+
+    value = os.path.expandvars(value) # expand environment variables
+    env = os.getenv(name, None)
+    if env is None:
+      os.environ[name] = value
+    else:
+      os.environ[name] = env + separator + value
+
 
 if __name__ == "__main__":
   args = sys.argv[1:]