Salome HOME
travail sur monPlusieurs
[tools/eficas.git] / Noyau / N_PROC.py
index 6e1b73fa99054cfb47039a0fb6f4d4045f23d4be..15e2823e26cf05870deee6395e403844cd5e0a2b 100644 (file)
@@ -1,24 +1,25 @@
-#@ MODIF N_PROC Noyau  DATE 09/10/2002   AUTEUR DURAND C.DURAND 
-#            CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR   
-# (AT YOUR OPTION) ANY LATER VERSION.                                 
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2013   EDF R&D
 #
-# THIS PROGRAM 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    
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.                            
+# 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.
 #
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE   
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,       
-#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.      
-#                                                                       
-#                                                                       
-# ======================================================================
-""" 
+# 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
+#
+
+
+"""
     Ce module contient la classe de definition PROC
     qui permet de spécifier les caractéristiques d'une procédure
 """
@@ -27,15 +28,16 @@ import types,string,traceback
 
 import N_ENTITE
 import N_PROC_ETAPE
+from strfunc import ufmt
 
 class PROC(N_ENTITE.ENTITE):
    """
     Classe pour definir un opérateur
 
-    Cette classe a deux attributs de classe 
+    Cette classe a deux attributs de classe
 
-    - class_instance qui indique la classe qui devra etre utilisée 
-            pour créer l'objet qui servira à controler la conformité d'un 
+    - class_instance qui indique la classe qui devra etre utilisée
+            pour créer l'objet qui servira à controler la conformité d'un
             opérateur avec sa définition
 
     - label qui indique la nature de l'objet de définition (ici, PROC)
@@ -107,6 +109,7 @@ class PROC(N_ENTITE.ENTITE):
          self.niveau.enregistre(self)
       self.UIinfo=UIinfo
       self.affecter_parente()
+      self.check_definition(self.nom)
 
    def __call__(self,**args):
       """
@@ -132,18 +135,12 @@ class PROC(N_ENTITE.ENTITE):
       """
           Méthode de vérification des attributs de définition
       """
-      if type(self.regles) != types.TupleType :
-        self.cr.fatal("L'attribut 'regles' doit etre un tuple : %s" %`self.regles`)
-      if type(self.fr) != types.StringType :
-        self.cr.fatal("L'attribut 'fr' doit etre une chaine de caractères : %s" %`self.fr`)
-      if self.reentrant not in ('o','n','f'):
-        self.cr.fatal("L'attribut 'reentrant' doit valoir 'o','n' ou 'f' : %s" %`self.reentrant`)
-      if type(self.docu) != types.StringType :
-        self.cr.fatal("L'attribut 'docu' doit etre une chaine de caractères : %s" %`self.docu` )
-      if type(self.nom) != types.StringType :
-        self.cr.fatal("L'attribut 'nom' doit etre une chaine de caractères : %s" %`self.nom`)
-      if type(self.op) != types.IntType :
-        self.cr.fatal("L'attribut 'op' doit etre un entier signé : %s" %`self.op`)
+      self.check_regles()
+      self.check_fr()
+      self.check_reentrant()
+      self.check_docu()
+      self.check_nom()
+      self.check_op(valmin=0)
       self.verif_cata_regles()
 
    def supprime(self):