]> SALOME platform Git repositories - tools/eficas.git/blobdiff - Editeur/listePatrons.py
Salome HOME
onItem=Deplie
[tools/eficas.git] / Editeur / listePatrons.py
index fe54d8547b001051aadcb8b1c093d76cc4c7f358..46c98908a207f2b3835c9e741e671d912287e85f 100644 (file)
@@ -1,8 +1,27 @@
+# Copyright (C) 2007-2013   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 import os
 import re
 
-sous_menus={"ASTER" : {0:{"3D":"3D.comm"},1:{"poutre":"pou.comm"},2:{"salome":"salome.comm"},3:{"divers":"comm"}},
-           "OPENTURNS" : {0:{"Anne":"Anne.comm"}}
+sous_menus={
+#          "OPENTURNS_STUDY" : {0:{"Essai":"Std.comm"}},
+#            "OPENTURNS_WRAPPER" : {0:{"Essai":"wrapper_exemple.comm"}},
            }
 
 class listePatrons :
@@ -10,12 +29,16 @@ class listePatrons :
     def __init__(self,code = "ASTER"):
        repIni=os.path.dirname(os.path.abspath(__file__))
        self.rep_patrons=repIni+"/Patrons/"+code
-       self.sous_menu=sous_menus[code]
+       self.sous_menu={}
+       if code in sous_menus.keys()  :
+          self.sous_menu=sous_menus[code]
        self.code=code
        self.liste={}
        self.traite_liste()
 
     def traite_liste(self):
+        if not (self.code in sous_menus.keys()) : return
+        if not (os.path.exists(self.rep_patrons)) : return
         for file in os.listdir(self.rep_patrons):
             for i in range(len(self.sous_menu)):
                 clef=self.sous_menu[i].keys()[0]