From: pascale.noyret Date: Wed, 23 Jun 2021 08:20:47 +0000 (+0200) Subject: partage Eric X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7508b382109d66e96577bd5ecbb3151c1ea78a96;p=tools%2Feficas.git partage Eric --- diff --git a/Vimmp/redefinitStep.py b/Vimmp/redefinitStep.py new file mode 100644 index 00000000..9093038d --- /dev/null +++ b/Vimmp/redefinitStep.py @@ -0,0 +1,17 @@ +def newGetattr(self,name): + listeRetour=[] + for step in self.step_Vimmp: + if step.__class__.__name__.find('T_'+name) == 0 : + listeRetour.append (step) + if len(listeRetour) > 0 : return listeRetour + raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name)) + +#def activeSurcharge(monType): +# + + +if __name__ == "__main__": + import cata_CSAndCPS_v18_karel_driver as m + m.T_Vimmp.__getattr__ = newGetattr + jdd = m.CreateFromDocument(open('test-karel.xml').read()) + print (jdd.Component[0])