From 57b525eacec9e97af519fe615c68175b215eb507 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Mon, 29 Oct 2007 12:44:14 +0000 Subject: [PATCH] ajout de unit pour les includes --- InterfaceQT/editor.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py index a1a079fa..f2031a85 100644 --- a/InterfaceQT/editor.py +++ b/InterfaceQT/editor.py @@ -30,8 +30,8 @@ class JDCEditor(QSplitter): Editeur de jdc """ - def __init__(self,fn = None, jdc = None ,parent=None, editor = None): - #-------------------------------------------------------------------# + def __init__(self,fn = None, jdc = None ,parent=None, editor = None, units = None): + #--------------------------------------------------------------------------------# QSplitter.__init__(self, parent,'') @@ -79,6 +79,11 @@ class JDCEditor(QSplitter): self.fileInfo.setCaching(0) if editor is None: self.jdc = self.readFile(self.fileName) + print "uuuuuuuuuuuuuuuuuuuuuuuuuuuu" + print self.fileName + if units is not None: + self.jdc.recorded_units=units + self.jdc.old_recorded_units=units else: self.top = editor.top self.code = editor.code @@ -96,7 +101,7 @@ class JDCEditor(QSplitter): self.jdc = editor.jdc else: if not self.jdc: # nouveau jdc - self.jdc = self._newJDC() + self.jdc = self._newJDC(units=units) if self.jdc: self.jdc.appli = self @@ -170,9 +175,9 @@ class JDCEditor(QSplitter): self.setCaption(cap) self.emit(PYSIGNAL('captionChanged'), (cap, self)) - #-------------------# - def _newJDC( self ): - #-------------------# + #--------------------------------# + def _newJDC( self ,units = None): + #--------------------------------# """ Initialise un nouveau JDC vierge """ @@ -183,6 +188,9 @@ class JDCEditor(QSplitter): cata_ord_dico=self.readercata.cata_ordonne_dico, rep_mat=self.CONFIGURATION.rep_mat ) + if units is not None: + jdc.recorded_units=units + jdc.old_recorded_units=units jdc.analyse() return jdc @@ -615,9 +623,6 @@ class JDCEditor(QSplitter): """ return self.saveFile(1, path) - - - if __name__=='__main__': if hasattr(prefs,'encoding'): -- 2.39.2