From: pascale.noyret Date: Thu, 16 Mar 2017 10:34:33 +0000 (+0100) Subject: Ajout methode generDico X-Git-Tag: Salome_8_3_Hydro_2_0rc1~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2f1862c4d6034ae20176577ceac664159bac71fa;p=modules%2Feficas.git Ajout methode generDico --- diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 9b79350f..291798a3 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -522,7 +522,15 @@ class JDCEditor(Ui_baseWidget,QWidget): a=self.monExe.readAllStandardOutput() self.w.view.append(QString.fromUtf8(a.data(),len(a))) ; - + #-----------------------# + def generDico(self): + #-----------------------# + print ('jkljlkjklj') + if 'dicoImbrique' in generator.plugins: + self.generator=generator.plugins['dico']() + jdc_formate=self.generator.gener(self.jdc) + dico=self.generator.Dico + return dico #-----------------------# def gestionParam(self): @@ -1221,6 +1229,7 @@ class JDCEditor(Ui_baseWidget,QWidget): the name of the saved file """ + print (self.generDico()) self.modified=1 if not self.modified and not saveas: return (0, None) # do nothing if text wasn't changed diff --git a/generator/generator_dico.py b/generator/generator_dico.py index bf935fba..1b08fdf9 100644 --- a/generator/generator_dico.py +++ b/generator/generator_dico.py @@ -70,6 +70,7 @@ class DicoGenerator(PythonGenerator): def initDico(self) : + self.Dico={} self.texteDico = "" @@ -91,6 +92,11 @@ class DicoGenerator(PythonGenerator): def generMCSIMP(self,obj) : """recuperation de l objet MCSIMP""" s=PythonGenerator.generMCSIMP(self,obj) + courant=self.Dico + for p in obj.get_genealogie_precise()[0:-1]: + if not (p in courant.keys()) : courant[p]={} + courant=courant[p] + courant[obj.nom]=obj.val self.texteDico+=obj.nom+ "=" + s[0:-1]+ "\n" return s