X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tree.py;h=061c74c6b33c1a93c617c8a6f76de57821d4caa1;hp=07576de8ca9df50c0e0877011aba989f03199176;hb=b19770356272772c8c8ba75f351520eca186bd19;hpb=42a67a41b64a6e0cc3fd2a63a0749e9aa4b9374c diff --git a/tree.py b/tree.py index 07576de..061c74c 100644 --- a/tree.py +++ b/tree.py @@ -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,7 +373,12 @@ 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 lems") + self.Bind(wx.EVT_MENU, self.OnExportDictionary, export_dictionary) + self.Bind(wx.EVT_MENU, self.OnExportLems, export_lems) + menu.AppendSeparator() itemdelete = menu.Append(wx.ID_ANY, "Supprimer de l'historique") if item == self.GetRootItem(): @@ -522,6 +525,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 +663,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.YES | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_QUESTION) if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: dlg.Destroy()