1 # -*- coding: utf-8 -*-
\r
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
\r
3 # ======================================================================
\r
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
\r
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
\r
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
\r
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
\r
8 # (AT YOUR OPTION) ANY LATER VERSION.
\r
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
\r
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
\r
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
\r
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
\r
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
\r
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
\r
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
\r
20 # ======================================================================
\r
22 Ce module sert pour charger les paramètres de configuration d'EFICAS
\r
25 import configuration
\r
29 class CONFIG(configuration.CONFIG_BASE):
\r
31 #-----------------------------------
\r
32 def __init__(self,appli,repIni):
\r
33 #-----------------------------------
\r
35 configuration.CONFIG_BASE.__init__(self,appli,repIni,'.Eficas_Openturns')
\r
36 self.INSTALLDIR =os.path.dirname(__file__)
\r
38 self.labels_user=['exec_acrobat', 'catalogues','savedir','path_doc','OpenTURNS_path']
\r
39 self.labels_eficas=["OpenTURNS_path","rep_user","INSTALLDIR","path_doc","exec_acrobat"]
\r
40 self.labels_eficas=self.labels_eficas+["rep_cata","initialdir","savedir","catalogues"]
\r
42 self.cataFile="catalogues_openturns.ini"
\r
45 #---------------------------------------
\r
46 def lecture_fichier_ini_standard(self):
\r
47 #---------------------------------------
\r
48 configuration.CONFIG_BASE.lecture_fichier_ini_standard(self)
\r
49 if hasattr(self,'OpenTURNS_path') :
\r
50 self.oldOTPath=self.OpenTURNS_path
\r
52 #---------------------------------------
\r
53 def lecture_fichier_ini_utilisateur(self):
\r
54 #---------------------------------------
\r
55 configuration.CONFIG_BASE.lecture_fichier_ini_utilisateur(self)
\r
56 if hasattr(self,'OpenTURNS_path') :
\r
57 if hasattr(self,'oldOTPath') and (self.OpenTURNS_path != self.oldOTPath):
\r
59 sys.path.remove(self.oldOTPath)
\r
60 sys.path[:0]=[self.OpenTURNS_path]
\r
61 self.oldOTPath=self.OpenTURNS_path
\r
63 def make_config(appli,rep):
\r
64 return CONFIG(appli,rep)
\r