From: Pierre Ratinaud Date: Thu, 18 Sep 2014 15:02:45 +0000 (+0200) Subject: ... X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=a0535abfee0078cf316bdd7cafcaa04805c086e9;p=iramuteq ... --- diff --git a/functions.py b/functions.py index 417e917..a26731b 100644 --- a/functions.py +++ b/functions.py @@ -55,6 +55,7 @@ class TGen : def writetable(self, pathout, tgens, totocc): etoiles = totocc.keys() + etoiles.sort() with open(pathout, 'w') as f : line = '\t'.join([u'tgens'] + etoiles) + '\n' f.write(line.encode(self.encoding)) diff --git a/listlex.py b/listlex.py index e0c7173..9244869 100644 --- a/listlex.py +++ b/listlex.py @@ -42,7 +42,6 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor if val.startswith(u'X.') : val = val.replace(u'X.', u'*') self.etoiles.append(val) - self.menu = menu #def start(self) : @@ -69,7 +68,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor self.selected = {} i=0 - for name in [u'formes'] + self.first : + for name in [u'formes'] + self.etoiles : self.InsertColumn(i,name,wx.LIST_FORMAT_LEFT) i+=1 diff --git a/textaslexico.py b/textaslexico.py index 35007b2..bb8e436 100644 --- a/textaslexico.py +++ b/textaslexico.py @@ -162,6 +162,7 @@ class Lexico(AnalyseText) : else : ListEt = variables[var[dial.list_box_1.GetSelections()[0]]] self.listet = ListEt + self.listet.sort() self.parametres['mineff'] = dial.spin.GetValue() if dial.choice_indice.GetSelection() == 0 : self.parametres['indice'] = 'hypergeo' @@ -219,6 +220,7 @@ class TgenSpec(AnalyseText): def doanalyse(self): self.tgen = TGen(path = self.parametres['tgenpath'], encoding = self.ira.syscoding) self.tgen.read(self.tgen.path) + self.parametres['etoiles'].sort() tgenocc, totocc = self.corpus.make_tgen_table(self.tgen, self.parametres['etoiles']) self.parametres['tgeneff'] = os.path.join(self.parametres['pathout'], 'tgeneff.csv') self.tgen.writetable(self.parametres['tgeneff'], tgenocc, totocc) diff --git a/tree.py b/tree.py index 3e05977..82aada2 100644 --- a/tree.py +++ b/tree.py @@ -697,11 +697,16 @@ class LeftTree(CT.CustomTreeCtrl): def OnTgenCompute(self, evt): corpus = self.page.corpus tgenpath = os.path.join(self.page.parametres['pathout'], 'tgen.csv') - self.page.parametres['tgenpath'] = tgenpath - tgen = TGen(path = tgenpath, encoding = self.parent.syscoding) - self.page.parametres['etoiles'] = self.page.etoiles - TgenSpec(self.parent, corpus, self.page.parametres) - TgenLayout(self.page) + if not os.path.exists(tgenpath) : + message = wx.MessageDialog(self.parent, _(u"No TGen yet !"), style = wx.ICON_EXCLAMATION | wx.OK) + message.ShowModal() + message.Destroy() + else : + self.page.parametres['tgenpath'] = tgenpath + tgen = TGen(path = tgenpath, encoding = self.parent.syscoding) + self.page.parametres['etoiles'] = self.page.etoiles + TgenSpec(self.parent, corpus, self.page.parametres) + TgenLayout(self.page) def OnExportClasses(self, event): corpus = self.page.corpus diff --git a/vitemspicker.py b/vitemspicker.py index 45a0746..df0cb2b 100644 --- a/vitemspicker.py +++ b/vitemspicker.py @@ -240,29 +240,3 @@ The items are displayed in the selection part of the widget''' self._OnAdd(e) else: self._OnRemove(e) - - - - -if __name__ == '__main__': - print 'ezerzerzer' - test = wx.App(0) - frame = wx.Frame(None, -1) - d = wx.Dialog(frame, style = wx.RESIZE_BORDER|wx.DEFAULT_DIALOG_STYLE) - - d.sizer = wx.BoxSizer(wx.VERTICAL) - d.sizer.Add(wx.StaticText(d, -1, label = 'Example of the ItemsPicker'), - 0, wx.ALL, 10) - ip = ItemsPicker(d, -1, ['pop', 'cool', 'lame'], - 'Stuff:', 'Selected stuff:',IP_SORT_SELECTED|IP_SORT_CHOICES|IP_REMOVE_FROM_CHOICES) - ip.add_button_label = u'left -> right' - ip.remove_button_label = u'right -> left' - d.sizer.Add(ip, 1, wx.EXPAND, 1) - d.SetSizer(d.sizer) - test.SetTopWindow(frame) - def callback(e): - print 'selected items', e.GetItems() - d.Bind(EVT_IP_SELECTION_CHANGED, callback) - d.ShowModal() - d.Destroy() - frame.Close() \ No newline at end of file