From: yfr Date: Tue, 20 Jul 2004 07:26:59 +0000 (+0000) Subject: DCQ:prepare 2.0.0 X-Git-Tag: V2_0_0~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4770f6c6846b3b83673e0a00986a1fc1763b767b;p=modules%2Fkernel.git DCQ:prepare 2.0.0 --- 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]