From 4770f6c6846b3b83673e0a00986a1fc1763b767b Mon Sep 17 00:00:00 2001 From: yfr Date: Tue, 20 Jul 2004 07:26:59 +0000 Subject: [PATCH] DCQ:prepare 2.0.0 --- bin/runSalome.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/runSalome.py b/bin/runSalome.py index 4348e148b..af5d4c114 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -35,18 +35,19 @@ def add_path(directory, variable_name): os.environ[variable_name] = "" pass if os.path.exists(directory): + newpath=[] for _dir in os.environ[variable_name].split(":"): if os.path.exists(_dir): - if os.path.samefile(_dir, directory): - return + if not os.path.samefile(_dir, directory): + newpath.append(_dir) else: - if os.path.abspath(_dir) == os.path.abspath(directory): - return + if os.path.abspath(_dir) != os.path.abspath(directory): + newpath.append(_dir) pass - if os.environ[variable_name] == "": - os.environ[variable_name] = directory - else: - os.environ[variable_name] = directory + ":" + os.environ[variable_name] + import string + newpath[:0] = [ directory ] + newpath = string.join(newpath,":") + os.environ[variable_name] = newpath if variable_name == "PYTHONPATH": sys.path[:0] = [directory] -- 2.39.2