1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2021 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 from __future__ import absolute_import
22 from __future__ import print_function
28 La regle I_AVANT verifie que l'on trouve l ordre des mots-cles
29 de la regle parmi les arguments d'un JDC.
31 Ces arguments sont transmis a la regle pour validation sous la forme
32 d'une liste de noms de mots-cles ou d'un dictionnaire dont
33 les cles sont des noms de mots-cles.
36 def __init__(self,*args):
38 print(("Erreur a la creation de la regle A_CLASSER(",args,")"))
40 if type(args[0]) == tuple:
41 self.listeAvant=args[0]
43 self.listeAvant=(args[0],)
44 if type(args[1]) == tuple:
45 self.listeApres=args[1]
47 self.listeApres=(args[1],)
51 args peut etre un dictionnaire ou une liste. Les elements de args
52 sont soit les elements de la liste soit les cles du dictionnaire.
54 # on compte le nombre de mots cles presents
60 if nom in self.listeAvant :
62 if boolListeApres == 1 :
64 if nom in self.listeApres :
66 if boolListeAvant == 0 and boolListeApres == 1 : boolOK = 0
71 text = "Regle de classement "' :\n'
72 for mc in self.listeAvant :
73 text = text + mc + ', '
74 text = text + " \nAvant : \n"
75 for mc in self.listeApres :
76 text = text + mc + ','