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'])
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)
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'])
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']) :