From 0df450e843879ee5cd6c237e8ed3603878d82265 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 12 Aug 2008 10:39:25 +0000 Subject: [PATCH] 0019954: Pb in setenv.py --- bin/setenv.py | 86 +++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/bin/setenv.py b/bin/setenv.py index 4d06f3885..14ae3c5bc 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -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 -- 2.39.2