From: crouzet Date: Wed, 16 Oct 2019 14:50:38 +0000 (+0200) Subject: add appenPath to python2 template X-Git-Tag: 5.5.0~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4e17ece34900e5bc9afc84a6a37b77f0612e95a;p=tools%2Fsat.git add appenPath to python2 template --- diff --git a/src/fileEnviron.py b/src/fileEnviron.py index 3c173e2..aa89e0d 100644 --- a/src/fileEnviron.py +++ b/src/fileEnviron.py @@ -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:]