Back to index

salome-geom  6.5.0
geom_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, OPEN CASCADE
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
00023 from salome_utils import getTmpDir, generateFileName, uniteFiles
00024 from setenv import salome_subdir
00025 
00026 # -----------------------------------------------------------------------------
00027 
00028 def set_env( args ):
00029     """Add to the PATH-variables modules specific paths"""
00030     
00031     tmp_dir = getTmpDir()
00032     env_dir = generateFileName( tmp_dir, prefix="env", with_port=True )
00033     res_dir = os.path.join( os.getenv( "GEOM_ROOT_DIR" ), "share", salome_subdir, "resources", "geom" )
00034 
00035     csf_list = ["Plugin", "GEOMDS_Resources", "ShHealing"]
00036 
00037     for csf_file in csf_list:
00038        uniteFiles( os.path.join( res_dir, csf_file ), os.path.join( env_dir, csf_file ) )
00039        pass
00040 
00041     for csf_string in csf_list:
00042         csf_var = "CSF_" + csf_string + "Defaults"
00043         if not os.getenv( csf_var ):
00044             os.environ[ csf_var ] = env_dir
00045             pass
00046         pass
00047