X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Noyau%2FN_JDC_CATA.py;h=16c91665cda38ae92a893b1bad5252ab54f33ac8;hb=2c5a8689b9c6cc46804fd268d416d1de2777059e;hp=4bb371a641e90652aebe4c1727d297a829871763;hpb=89764aa6a88580ac1df0ea52746b437a7cee66d1;p=tools%2Feficas.git diff --git a/Noyau/N_JDC_CATA.py b/Noyau/N_JDC_CATA.py index 4bb371a6..16c91665 100644 --- a/Noyau/N_JDC_CATA.py +++ b/Noyau/N_JDC_CATA.py @@ -1,24 +1,27 @@ -#@ MODIF N_JDC_CATA 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 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. +# +# 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 # -# 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. # -# 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. -# -# # ====================================================================== -""" + + +""" Ce module contient la classe de definition JDC_CATA qui permet de spécifier les caractéristiques d'un JDC """ @@ -27,6 +30,7 @@ import types,string,traceback import N_ENTITE import N_JDC +from strfunc import ufmt class JDC_CATA(N_ENTITE.ENTITE): """ @@ -34,8 +38,8 @@ class JDC_CATA(N_ENTITE.ENTITE): Attributs de classe : - - class_instance qui indique la classe qui devra etre utilisée - pour créer l'objet qui servira à controler la conformité + - class_instance qui indique la classe qui devra etre utilisée + pour créer l'objet qui servira à controler la conformité du jeu de commandes avec sa définition - label qui indique la nature de l'objet de définition (ici, JDC) @@ -61,7 +65,7 @@ class JDC_CATA(N_ENTITE.ENTITE): self.commandes=[] for niveau in niveaux: self.d_niveaux[niveau.nom]=niveau - # On change d'objet catalogue. Il faut d'abord mettre le catalogue + # On change d'objet catalogue. Il faut d'abord mettre le catalogue # courant à None CONTEXT.unset_current_cata() CONTEXT.set_current_cata(self) @@ -89,8 +93,7 @@ class JDC_CATA(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`) + self.check_regles() self.verif_cata_regles() def verif_cata_regles(self): @@ -104,13 +107,13 @@ class JDC_CATA(N_ENTITE.ENTITE): """ Methode pour produire un compte-rendu de validation d'un catalogue de commandes """ - self.cr = self.CR(debut = "Compte-rendu de validation du catalogue "+self.code, - fin = "Fin Compte-rendu de validation du catalogue "+self.code) + self.cr = self.CR(debut = u"Compte-rendu de validation du catalogue "+self.code, + fin = u"Fin Compte-rendu de validation du catalogue "+self.code) self.verif_cata() for commande in self.commandes: cr = commande.report() - cr.debut = "Début Commande :"+commande.nom - cr.fin = "Fin commande :"+commande.nom + cr.debut = u"Début Commande :"+commande.nom + cr.fin = u"Fin commande :"+commande.nom self.cr.add(cr) return self.cr