]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
0019954: Pb in setenv.py
authordmv <dmv@opencascade.com>
Tue, 12 Aug 2008 10:39:25 +0000 (10:39 +0000)
committerdmv <dmv@opencascade.com>
Tue, 12 Aug 2008 10:39:25 +0000 (10:39 +0000)
bin/setenv.py

index 4d06f38853e119fc4a4bdc4dc1c05828945b7c01..14ae3c5bcdb3e6eb5dbe6f08eb979a7765e525e1 100755 (executable)
@@ -189,9 +189,46 @@ def set_env(args, modules_list, modules_root_dir, silent=False):
                                   salome_subdir,
                                   "shared_modules"),
                      "PYTHONPATH")
-            pass
-        pass
 
+            # set environment for SMESH plugins
+           if module == "SMESH" :
+               os.environ["SMESH_MeshersList"]="StdMeshers"
+               if not os.environ.has_key("SALOME_StdMeshersResources"):
+                   os.environ["SALOME_StdMeshersResources"] \
+                    = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh"
+                    pass
+               if args.has_key("SMESH_plugins"):
+                    for plugin in args["SMESH_plugins"]:
+                        plugin_root = ""
+                        if os.environ.has_key(plugin+"_ROOT_DIR"):
+                            plugin_root = os.environ[plugin+"_ROOT_DIR"]
+                        else:
+                            # workaround to avoid modifications of existing environment
+                            if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+                                plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
+                                pass
+                            pass
+                        if plugin_root != "":
+                            os.environ["SMESH_MeshersList"] \
+                            = os.environ["SMESH_MeshersList"]+":"+plugin
+                            if not os.environ.has_key("SALOME_"+plugin+"Resources"):
+                                os.environ["SALOME_"+plugin+"Resources"] \
+                                = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
+                                add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH")
+                                add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH")
+                                
+                                if sys.platform == "win32":
+                                    add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
+                                else:
+                                    add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
+                                    add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
+                                    add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH")
+                                    pass
+                                pass
+                            pass
+                        pass
+                    pass
+                    
     if sys.platform == 'win32':
         os.environ["SALOMEPATH"]=";".join(modules_root_dir_list)
     else:
@@ -206,51 +243,6 @@ def set_env(args, modules_list, modules_root_dir, silent=False):
     if args['logger']:
         os.environ["SALOME_trace"]="with_logger"
 
-    # set environment for SMESH plugins
-
-    if "SMESH" in modules_list:
-        os.environ["SMESH_MeshersList"]="StdMeshers"
-        if not os.environ.has_key("SALOME_StdMeshersResources"):
-            os.environ["SALOME_StdMeshersResources"] \
-            = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh"
-            pass
-        if args.has_key("SMESH_plugins"):
-            for plugin in args["SMESH_plugins"]:
-                plugin_root = ""
-                if os.environ.has_key(plugin+"_ROOT_DIR"):
-                    plugin_root = os.environ[plugin+"_ROOT_DIR"]
-                else:
-                    # workaround to avoid modifications of existing environment
-                    if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
-                        plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
-                        pass
-                    pass
-                if plugin_root != "":
-                    os.environ["SMESH_MeshersList"] \
-                    = os.environ["SMESH_MeshersList"]+":"+plugin
-                    if not os.environ.has_key("SALOME_"+plugin+"Resources"):
-                        os.environ["SALOME_"+plugin+"Resources"] \
-                        = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
-                    add_path(os.path.join(plugin_root,get_lib_dir(),python_version,
-                                          "site-packages",salome_subdir),
-                             "PYTHONPATH")
-                    add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
-                             "PYTHONPATH")
-
-
-                    if sys.platform == "win32":
-                      add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
-                          "PATH")
-                    else:
-                      add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
-                               "LD_LIBRARY_PATH")
-                    add_path(os.path.join(plugin_root,"bin",salome_subdir),
-                             "PYTHONPATH")
-                    add_path(os.path.join(plugin_root,"bin",salome_subdir),
-                             "PATH")
-            pass
-        pass
-
     # set environment for SUPERV module
     os.environ["ENABLE_MACRO_NODE"]="1"
     # set resources variables if not yet set