]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
DCQ:prepare 2.0.0
authoryfr <yfr@opencascade.com>
Tue, 20 Jul 2004 07:26:59 +0000 (07:26 +0000)
committeryfr <yfr@opencascade.com>
Tue, 20 Jul 2004 07:26:59 +0000 (07:26 +0000)
bin/runSalome.py

index 4348e148b7d22a0cf0b59b3dda766efb9e6e6205..af5d4c114f9fd937b6f52431a65999d6ff04568c 100755 (executable)
@@ -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]