Salome HOME
0022227: [CEA 827] Building a surface from a cloud of points
[modules/geom.git] / bin / geom_setenv.py
1 #! /usr/bin/env python
2 #  -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21
22 import os
23 from salome_utils import getTmpDir, generateFileName, uniteFiles
24 from setenv import salome_subdir
25
26 # -----------------------------------------------------------------------------
27
28 def set_env( args ):
29     """Add to the PATH-variables modules specific paths"""
30     
31     tmp_dir = getTmpDir()
32     env_dir = generateFileName( tmp_dir, prefix="env", with_port=True )
33     res_dir = os.path.join( os.getenv( "GEOM_ROOT_DIR" ), "share", salome_subdir, "resources", "geom" )
34
35     csf_list = ["Plugin", "GEOMDS_Resources", "ShHealing"]
36
37     for csf_file in csf_list:
38        uniteFiles( os.path.join( res_dir, csf_file ), os.path.join( env_dir, csf_file ) )
39        pass
40
41     for csf_string in csf_list:
42         csf_var = "CSF_" + csf_string + "Defaults"
43         if not os.getenv( csf_var ):
44             os.environ[ csf_var ] = env_dir
45             pass
46         pass
47