Back to index

salome-paravis  6.5.0
paravis_setenv.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 #  -*- coding: iso-8859-1 -*-
00003 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00004 #
00005 # This library is free software; you can redistribute it and/or
00006 # modify it under the terms of the GNU Lesser General Public
00007 # License as published by the Free Software Foundation; either
00008 # version 2.1 of the License.
00009 #
00010 # This library is distributed in the hope that it will be useful,
00011 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 # Lesser General Public License for more details.
00014 #
00015 # You should have received a copy of the GNU Lesser General Public
00016 # License along with this library; if not, write to the Free Software
00017 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018 #
00019 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00020 #
00021 
00022 import os, re
00023 
00024 # -----------------------------------------------------------------------------
00025 
00026 def set_env( args ):
00027     """Initialize environment of PARAVIS module"""
00028     from salome_utils import verbose
00029     # set PV_PLUGIN_PATH to PARAVIS plug-ins
00030     paravis_plugin_dir = os.path.join( os.getenv( "PARAVIS_ROOT_DIR" ), "lib", "paraview" )
00031     plugin_path = re.split( ":|;", os.getenv( 'PV_PLUGIN_PATH', paravis_plugin_dir ) )
00032     if paravis_plugin_dir not in plugin_path: plugin_path[0:0] = [paravis_plugin_dir]
00033     os.environ['PV_PLUGIN_PATH'] = ";".join(plugin_path)
00034     pass
00035 
00036