X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tree.py;h=65907054c1d5e236eb49025537481265a4b7cbca;hp=e9ab091cd1f692c58c53ec5741cba09880593e36;hb=abb846ef2ccc94411e3531dca062b75a2809b212;hpb=7fb5b2b86f6c9a0617208ee85211177c23d12f47 diff --git a/tree.py b/tree.py index e9ab091..6590705 100644 --- a/tree.py +++ b/tree.py @@ -340,19 +340,19 @@ class LeftTree(CT.CustomTreeCtrl): stat = menu.Append(wx.ID_ANY, u"Statistiques") spec = menu.Append(wx.ID_ANY, u"Spécificté et AFC") classification = wx.Menu() - alceste = classification.Append(wx.ID_ANY, u"Méthode ALCESTE") - pam = classification.Append(wx.ID_ANY, u"Par matrice des distances") + alceste = classification.Append(wx.ID_ANY, u"Méthode GNEPA") + #pam = classification.Append(wx.ID_ANY, u"Par matrice des distances") menu.AppendMenu(-1, u"Classification", classification) simi = menu.Append(wx.ID_ANY, u"Analyse de similitude") wdc = menu.Append(wx.ID_ANY, u"Nuage de mots") menu.AppendSeparator() self.Bind(wx.EVT_MENU, self.OnAlceste, alceste) - self.Bind(wx.EVT_MENU, self.OnPam, pam) + #self.Bind(wx.EVT_MENU, self.OnPam, pam) self.Bind(wx.EVT_MENU, self.OnStat, stat) self.Bind(wx.EVT_MENU, self.OnSpec, spec) self.Bind(wx.EVT_MENU, self.OnSimiTxt, simi) self.Bind(wx.EVT_MENU, self.OnWordCloud, wdc) - elif pydata.get('type', False) == 'alceste' and pydata['uuid'] in self.parent.history.opened : + elif pydata.get('type', False) == 'alceste' and pydata['uuid'] in self.parent.history.opened : openmenu = wx.Menu() antipro = openmenu.Append(wx.ID_ANY, u"antiprofils") menu.AppendMenu(wx.ID_ANY, u"Ouvrir...", openmenu) @@ -364,9 +364,7 @@ class LeftTree(CT.CustomTreeCtrl): navig = menu.Append(wx.ID_ANY, u"Outil de navigation") statclasse = menu.Append(wx.ID_ANY, u"Statistiques par classe") rapport = menu.Append(wx.ID_ANY, u"Rapport") - menu.AppendSeparator() - self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro) self.Bind(wx.EVT_MENU, self.OnProfSR, profsr) self.Bind(wx.EVT_MENU, self.OnProfGram, profgram) @@ -375,6 +373,17 @@ class LeftTree(CT.CustomTreeCtrl): self.Bind(wx.EVT_MENU, self.OnNavig, navig) self.Bind(wx.EVT_MENU, self.StatClasse, statclasse) self.Bind(wx.EVT_MENU, self.OnRapport, rapport) + elif pydata.get('type', False) == 'stat' and pydata['uuid'] in self.parent.history.opened : + export_dictionary = menu.Append(wx.ID_ANY, u"Exporter le dictionnaire") + export_lems = menu.Append(wx.ID_ANY, u"Exporter le dictionnaire des lemmes") + self.Bind(wx.EVT_MENU, self.OnExportDictionary, export_dictionary) + self.Bind(wx.EVT_MENU, self.OnExportLems, export_lems) + menu.AppendSeparator() + elif pydata.get('type', False) == 'gnepamatrix' and pydata['uuid'] in self.parent.history.opened : + openmenu = wx.Menu() + antipro = openmenu.Append(wx.ID_ANY, u"antiprofils") + menu.AppendMenu(wx.ID_ANY, u"Ouvrir...", openmenu) + self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro) itemdelete = menu.Append(wx.ID_ANY, "Supprimer de l'historique") @@ -422,7 +431,7 @@ class LeftTree(CT.CustomTreeCtrl): self.parent.OnTextAlceste(evt, self.getcorpus()) def OnPam(self, evt) : - print 'rien' + self.parent.OnPamSimple(evt, self.getcorpus()) def OnSimiTxt(self, evt) : self.parent.OnSimiTxt(evt, self.getcorpus()) @@ -522,6 +531,22 @@ class LeftTree(CT.CustomTreeCtrl): else : dial.Destroy() + def OnExportDictionary(self, evt) : + corpus = self.page.corpus + corpus.export_dictionary(self.page.pathout['dictionary.csv'], self.parent.syscoding) + log.info('export dictionary %s' % self.page.pathout['dictionary.csv']) + dial = wx.MessageDialog(self.parent, self.page.pathout['dictionary.csv'], 'Export', wx.OK) + dial.ShowModal() + dial.Destroy() + + def OnExportLems(self, evt) : + corpus = self.page.corpus + corpus.export_lems(self.page.pathout['lemmes.csv'], self.parent.syscoding) + log.info('export lemmes %s' % self.page.pathout['lemmes.csv']) + dial = wx.MessageDialog(self.parent, self.page.pathout['lemmes.csv'], 'Export', wx.OK) + dial.ShowModal() + dial.Destroy() + def OnItemBackground(self, event): colourdata = wx.ColourData() @@ -644,7 +669,7 @@ class LeftTree(CT.CustomTreeCtrl): def OnItemDelete(self, event): strs = "Are You Sure You Want To Delete Item " + self.GetItemText(self.current) + "?" - dlg = wx.MessageDialog(None, strs, 'Deleting Item', wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_QUESTION) + dlg = wx.MessageDialog(None, strs, 'Deleting Item', wx.OK | wx.CANCEL | wx.ICON_QUESTION) if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: dlg.Destroy()