-#@ MODIF N_OPER Noyau DATE 27/03/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 OPER
qui permet de spécifier les caractéristiques d'un opérateur
"""
import N_ENTITE
import N_ETAPE
import nommage
+from strfunc import ufmt
class OPER(N_ENTITE.ENTITE):
"""
Classe pour definir un opérateur
- Cette classe a trois attributs de classe
+ Cette classe a trois 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, OPER)
nommage = nommage
def __init__(self,nom,op,sd_prod,reentrant='n',repetable='o',fr="",ang="",
- docu="",regles=(),op_init=None,niveau = None,**args):
+ docu="",regles=(),op_init=None,niveau = None,UIinfo=None,**args):
"""
Méthode d'initialisation de l'objet OPER. Les arguments sont utilisés pour initialiser
les attributs de meme nom
else:
self.niveau=current_cata.get_niveau(niveau)
self.niveau.enregistre(self)
+ self.UIinfo=UIinfo
self.affecter_parente()
+ self.check_definition(self.nom)
def __call__(self,reuse=None,**args):
"""
return etape.Build_sd(nomsd)
def make_objet(self,mc_list='oui'):
- """
+ """
Cette méthode crée l'objet ETAPE dont la définition est self sans
l'enregistrer ni créer sa sdprod.
- Si l'argument mc_list vaut 'oui', elle déclenche en plus la construction
+ Si l'argument mc_list vaut 'oui', elle déclenche en plus la construction
des objets MCxxx.
"""
etape= self.class_instance(oper=self,reuse=None,args={})
"""
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):