From: Pierre Date: Tue, 8 Jan 2013 22:32:03 +0000 (+0100) Subject: ... X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=ba7e45a167c8cd7a796efe332a4bf61dc864b373;p=iramuteq ... --- diff --git a/dialog.py b/dialog.py index 71b0e6f..60eb10d 100755 --- a/dialog.py +++ b/dialog.py @@ -662,6 +662,7 @@ au chi2 d'association de la forme""" self.film.Enable(False) self.spin_f3.Enable(False) self.slider_sphere.Enable(False) + self.choix_format.SetSelection(self.paramgraph['svg']) self.choice1.SetSelection(self.paramgraph['what']) self.choice2.SetSelection(self.paramgraph['qui']) self.spin_chi.SetValue(self.paramgraph['select_nb']) diff --git a/functions.py b/functions.py index 730d135..8a10f67 100644 --- a/functions.py +++ b/functions.py @@ -77,9 +77,25 @@ class History : self.write() self.read() + def addmultiple(self, analyses) : + for analyse in analyses : + tosave = {'uuid' : analyse['uuid'], 'ira': analyse['ira'], 'type' : analyse['type']} + corpus = analyse['uuid'] + tosave['corpus'] = corpus + tosave['name'] = analyse['name'] + if corpus in self.corpus : + if 'analyses' in self.history[self.ordercorpus[corpus]] : + self.history[self.ordercorpus[corpus]]['analyses'].append(tosave) + else : + self.history[self.ordercorpus[corpus]]['analyses'] = [tosave] + self.write() + self.read() + def delete(self, analyse, corpus = False) : if corpus : self.history.pop(self.ordercorpus[analyse['uuid']]) + if analyse['uuid'] in self.openedcorpus : + del self.openedcorpus[analyse['uuid']] else : todel = [i for i, ana in enumerate(self.corpus[analyse['corpus']]['analyses']) if ana['uuid'] == analyse['uuid']][0] self.history[self.ordercorpus[analyse['corpus']]]['analyses'].pop(todel) diff --git a/openanalyse.py b/openanalyse.py index 8957f2a..33792b8 100644 --- a/openanalyse.py +++ b/openanalyse.py @@ -64,7 +64,7 @@ class OpenAnalyse(): log.info('add to history') self.parent.tree.OnItemAppend(self.conf) if self.conf['uuid'] in self.parent.history.openedcorpus : - log.info('corpus is already opened') + log.info('corpus is already opened 1') self.doopen(self.parent.history.openedcorpus[self.conf['uuid']]) else : corpus = Corpus(self, parametres = self.conf, read = self.parent.history.history[self.parent.history.ordercorpus[self.conf['uuid']]]['ira']) @@ -73,19 +73,24 @@ class OpenAnalyse(): self.doopen(corpus) def opencorpus_analyses(self) : + log.info('open analysis') basepath = self.conf['pathout'] + analyses = [] for root, subfolders, files in os.walk(basepath) : for folder in subfolders : if os.path.exists(os.path.join(folder, 'Analyse.ira')) : analyse_conf = DoConf(os.path.join(folder, 'Analyse.ira')).getoptions() analyse_conf = self.redopath(analyse_conf, os.path.join(folder, 'Analyse.ira')) if analyse_conf['corpus'] == self.conf['uuid'] : - self.parent.history.add(analyse_conf) - self.parent.tree.AddAnalyse(analyse_conf, bold = False) + analyses.append(analyse_conf) + if len(analyses) : + self.parent.history.addmultiple(analyses) + for analyse in analyses : + self.parent.tree.AddAnalyse(analyse, bold = False) def openanalyse(self) : if self.conf['corpus'] in self.parent.history.openedcorpus : - log.info('corpus is already opened') + log.info('corpus is already opened 2') corpus = self.parent.history.openedcorpus[self.conf['corpus']] else : if os.path.exists(self.parent.history.history[self.parent.history.ordercorpus[self.conf['corpus']]]['ira']) :