1 # Copyright (C) 2007-2013 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # "OPENTURNS_STUDY" : {0:{"Essai":"Std.comm"}},
24 # "OPENTURNS_WRAPPER" : {0:{"Essai":"wrapper_exemple.comm"}},
29 def __init__(self,code = "ASTER"):
30 repIni=os.path.dirname(os.path.abspath(__file__))
31 self.rep_patrons=repIni+"/Patrons/"+code
33 if code in sous_menus.keys() :
34 self.sous_menu=sous_menus[code]
39 def traite_liste(self):
40 if not (self.code in sous_menus.keys()) : return
41 if not (os.path.exists(self.rep_patrons)) : return
42 for file in os.listdir(self.rep_patrons):
43 for i in range(len(self.sous_menu)):
44 clef=self.sous_menu[i].keys()[0]
45 chaine=self.sous_menu[i][clef]
46 if re.search(chaine,file) :
47 if clef in self.liste.keys():
48 self.liste[clef].append(file)
50 self.liste[clef]=[file]