X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Ihm%2FI_MCFACT.py;h=fc7d4a9f87f281c2af89c1e31e7e6a8f3b7315d7;hb=217a9ce2f303b098ad28d282bb0df2dfeeeed3c2;hp=348341f1ef40892790a09eed73d5cb74b390a3d1;hpb=b7f5c11ba66fb9c4f03ee3968fc7bfee44468d1c;p=tools%2Feficas.git diff --git a/Ihm/I_MCFACT.py b/Ihm/I_MCFACT.py index 348341f1..fc7d4a9f 100644 --- a/Ihm/I_MCFACT.py +++ b/Ihm/I_MCFACT.py @@ -17,17 +17,17 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +from __future__ import absolute_import from Extensions.i18n import tr -import CONNECTOR -import I_MCCOMPO +from . import CONNECTOR +from . import I_MCCOMPO import Noyau -import string class MCFACT(I_MCCOMPO.MCCOMPO): def isrepetable(self): """ - Indique si l'objet est répétable. - Retourne 1 si le mot-clé facteur self peut être répété + Indique si l'objet est repetable. + Retourne 1 si le mot-cle facteur self peut etre repete Retourne 0 dans le cas contraire """ if self.definition.max > 1: @@ -37,7 +37,10 @@ class MCFACT(I_MCCOMPO.MCCOMPO): return 0 def isoblig(self): - return self.definition.statut=='o' + if self.definition.statut != 'o' : return 0 + objet = self.parent.get_child(self.nom) + if len(objet) > 1 : return 0 + else : return 1 def getlabeltext(self): """ @@ -52,8 +55,8 @@ class MCFACT(I_MCCOMPO.MCCOMPO): try: if len(objet) > 1 : - index = objet.get_index(self)+1 # + 1 à cause de la numérotation qui commence à 0 - return self.nom +'_'+`index`+':' + index = objet.get_index(self)+1 # + 1 a cause de la numerotation qui commence a 0 + return self.nom +'_'+repr(index)+':' else: return self.nom except: @@ -64,15 +67,15 @@ class MCFACT(I_MCCOMPO.MCCOMPO): if nom[-1]==':' : nom=nom[0:-1] if self.parent: l=self.parent.get_genealogie_precise() - l.append(string.strip(nom)) + l.append(nom.strip()) return l else: - return [string.strip(nom)] + return [nom.strip()] def init_modif(self): """ - Met l'état de l'objet à modified et propage au parent + Met l'etat de l'objet a modified et propage au parent qui vaut None s'il n'existe pas """ self.state = 'modified' @@ -82,11 +85,11 @@ class MCFACT(I_MCCOMPO.MCCOMPO): def fin_modif(self): """ - Méthode appelée après qu'une modification a été faite afin de déclencher - d'éventuels traitements post-modification + Methode appelee apres qu'une modification a ete faite afin de declencher + d'eventuels traitements post-modification """ #print "fin_modif",self - # pour les objets autres que les commandes, aucun traitement spécifique + # pour les objets autres que les commandes, aucun traitement specifique # on remonte l'info de fin de modif au parent CONNECTOR.Emit(self,"valid") parent= hasattr(self,"alt_parent") and self.alt_parent or self.parent @@ -94,7 +97,7 @@ class MCFACT(I_MCCOMPO.MCCOMPO): parent.fin_modif() def normalize(self): - """ Retourne le MCFACT normalisé. Pour un MCFACT isolé, l'objet normalisé + """ Retourne le MCFACT normalise. Pour un MCFACT isole, l'objet normalise est une MCLIST de longueur 1 qui contient ce MCFACT """ new_obj = self.definition.list_instance()