From 2f1862c4d6034ae20176577ceac664159bac71fa Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Thu, 16 Mar 2017 11:34:33 +0100 Subject: [PATCH] Ajout methode generDico --- InterfaceQT4/editor.py | 11 ++++++++++- generator/generator_dico.py | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 -- 2.39.2