Salome HOME
modif Yoann
[tools/eficas.git] / Openturns_Wrapper / configuration_OPENTURNS_WRAPPER.py
1 # -*- coding: utf-8 -*-\r
2 # Copyright (C) 2007-2013   EDF R&D\r
3 #\r
4 # This library is free software; you can redistribute it and/or\r
5 # modify it under the terms of the GNU Lesser General Public\r
6 # License as published by the Free Software Foundation; either\r
7 # version 2.1 of the License.\r
8 #\r
9 # This library is distributed in the hope that it will be useful,\r
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
12 # Lesser General Public License for more details.\r
13 #\r
14 # You should have received a copy of the GNU Lesser General Public\r
15 # License along with this library; if not, write to the Free Software\r
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
17 #\r
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
19 #\r
20 """\r
21     Ce module sert pour charger les paramètres de configuration d'EFICAS\r
22 """\r
23 # Modules Python\r
24 import configuration\r
25 import os\r
26 \r
27 \r
28 class CONFIG(configuration.CONFIG_BASE):\r
29 \r
30   #-----------------------------------\r
31   def __init__(self,appli,repIni):\r
32   #-----------------------------------\r
33 \r
34 \r
35       self.labels_user=['exec_acrobat', 'catalogues','savedir','path_doc']\r
36       self.labels_eficas=["OpenTURNS_path","path_doc","exec_acrobat"]\r
37       self.labels_eficas=self.labels_eficas+["rep_cata","lang","catalogues"]\r
38       configuration.CONFIG_BASE.__init__(self,appli,repIni)\r
39 \r
40   #---------------------------------------\r
41   def lecture_fichier_ini_standard(self):\r
42   #---------------------------------------\r
43        configuration.CONFIG_BASE.lecture_fichier_ini_standard(self)\r
44        if hasattr(self,'OpenTURNS_path') : self.oldOTPath=self.OpenTURNS_path\r
45 \r
46   #---------------------------------------\r
47   def lecture_fichier_ini_integrateur(self):\r
48   #---------------------------------------\r
49        configuration.CONFIG_BASE.lecture_fichier_ini_utilisateur(self)\r
50        if hasattr(self,'OpenTURNS_path') :\r
51           if hasattr(self,'oldOTPath') and (self.OpenTURNS_path != self.oldOTPath):\r
52                import sys\r
53                sys.path.remove(self.oldOTPath)\r
54                sys.path[:0]=[self.OpenTURNS_path]\r
55                self.oldOTPath=self.OpenTURNS_path\r
56 \r
57 def make_config(appli,rep):\r
58     return CONFIG(appli,rep)\r
59 \r