Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 import os, sys
00023 from setenv import add_path, get_lib_dir, salome_subdir
00024
00025
00026
00027 def set_env(args):
00028 """Add to the PATH-variables modules specific paths"""
00029
00030 python_version="python%d.%d" % sys.version_info[0:2]
00031
00032 os.environ["SMESH_MeshersList"]="StdMeshers"
00033 if not os.environ.has_key("SALOME_StdMeshersResources"):
00034 os.environ["SALOME_StdMeshersResources"] \
00035 = os.environ["SMESH_ROOT_DIR"]+"/share/"+salome_subdir+"/resources/smesh"
00036 pass
00037 if args.has_key("SMESH_plugins"):
00038 for plugin in args["SMESH_plugins"]:
00039 plugin_root = ""
00040 if os.environ.has_key(plugin+"_ROOT_DIR"):
00041 plugin_root = os.environ[plugin+"_ROOT_DIR"]
00042 else:
00043
00044 if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
00045 plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
00046 pass
00047 pass
00048 if plugin_root != "":
00049 os.environ["SMESH_MeshersList"] \
00050 = os.environ["SMESH_MeshersList"]+":"+plugin
00051 if not os.environ.has_key("SALOME_"+plugin+"Resources"):
00052 os.environ["SALOME_"+plugin+"Resources"] \
00053 = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
00054 add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH")
00055 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH")
00056
00057 if sys.platform == "win32":
00058 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
00059 add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
00060 else:
00061 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
00062 add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
00063 add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH")
00064 pass
00065 pass
00066 pass
00067 pass