1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013 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
26 La règle I_AVANT vérifie que l'on trouve l ordre des mots-clés
27 de la règle parmi les arguments d'un JDC.
29 Ces arguments sont transmis à la règle pour validation sous la forme
30 d'une liste de noms de mots-clés ou d'un dictionnaire dont
31 les clés sont des noms de mots-clés.
34 def __init__(self,*args):
36 print "Erreur à la création de la règle A_CLASSER(",args,")"
38 if type(args[0]) == types.TupleType:
39 self.listeAvant=args[0]
41 self.listeAvant=(args[0],)
42 if type(args[1]) == types.TupleType:
43 self.listeApres=args[1]
45 self.listeApres=(args[1],)
49 args peut etre un dictionnaire ou une liste. Les éléments de args
50 sont soit les éléments de la liste soit les clés du dictionnaire.
52 # on compte le nombre de mots cles presents
58 if nom in self.listeAvant :
60 if boolListeApres == 1 :
62 if nom in self.listeApres :
64 if boolListeAvant == 0 and boolListeApres == 1 : boolOK = 0
69 text = "Regle de classement "' :\n'
70 for mc in self.listeAvant :
71 text = text + mc + ', '
72 text = text + " \nAvant : \n"
73 for mc in self.listeApres :
74 text = text + mc + ','