X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Noyau%2FN_OPER.py;h=e5e8a0372d1744352fbf074f682e8ded543cd5f7;hb=2c5a8689b9c6cc46804fd268d416d1de2777059e;hp=5e43776ed7f2ce9ef2ed9a979cc8059cbef285fd;hpb=e48d543f878c604958b5f1e6ac6d92a8392356e4;p=tools%2Feficas.git diff --git a/Noyau/N_OPER.py b/Noyau/N_OPER.py index 5e43776e..e5e8a037 100644 --- a/Noyau/N_OPER.py +++ b/Noyau/N_OPER.py @@ -1,24 +1,24 @@ -#@ MODIF N_OPER 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 OPER qui permet de spécifier les caractéristiques d'un opérateur """ @@ -28,15 +28,16 @@ import types,string,traceback 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) @@ -114,6 +115,7 @@ class OPER(N_ENTITE.ENTITE): self.niveau.enregistre(self) self.UIinfo=UIinfo self.affecter_parente() + self.check_definition(self.nom) def __call__(self,reuse=None,**args): """ @@ -126,10 +128,10 @@ class OPER(N_ENTITE.ENTITE): 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={}) @@ -140,18 +142,12 @@ class OPER(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):