X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=listlex.py;fp=listlex.py;h=e0c7173c6f0dd76c93d997523548b2a2e1043910;hp=5f22405e843f4811bd110ce1e0cfb3f7ac3a7953;hb=6523e3596df7ec9b7b94b875593953d4b34b6117;hpb=a38c33bb022324119c865d990e7ef1f087c24780 diff --git a/listlex.py b/listlex.py index 5f22405..e0c7173 100644 --- a/listlex.py +++ b/listlex.py @@ -18,10 +18,10 @@ import wx import wx.lib.mixins.listctrl as listmix import cStringIO import tempfile -from functions import exec_rcode, MessageImage, doconcorde +from functions import exec_rcode, doconcorde from chemins import ffr from PrintRScript import barplot -from dialog import SearchDial, message +from dialog import SearchDial, message, BarGraphDialog, MessageImage, BarFrame from operator import itemgetter #--------------------------------------------------------------------------- @@ -230,9 +230,11 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor for forme in lems[word].formes : rep.append([corpus.getforme(forme).forme, corpus.getforme(forme).freq]) rep.sort(key = itemgetter(1), reverse = True) - win = message(self, u"Formes associées", (300, 200)) - win.html = '\n' + '
'.join([' : '.join([str(val) for val in forme]) for forme in rep]) + '\n' - win.HtmlPage.SetPage(win.html) + items = dict([[i, '' + '\t:\t'.join([str(val) for val in forme]) + ''] for i, forme in enumerate(rep)]) + win = message(self, items, u"Formes associées", (300, 200)) + #win = message(self, u"Formes associées", (300, 200)) + #win.html = '\n' + '
'.join([' : '.join([str(val) for val in forme]) for forme in rep]) + '\n' + #win.HtmlPage.SetPage(win.html) win.Show(True) def onstcaract(self, evt) : @@ -316,17 +318,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor colnames = self.first table = [[self.getinf(val) for val in line[1:]] for line in datas] rownames = [val[0] for val in datas] - tmpgraph = tempfile.mktemp(dir=self.parent.TEMPDIR) - txt = barplot(table, rownames, colnames, self.parent.RscriptsPath['Rgraph'], tmpgraph) - tmpscript = tempfile.mktemp(dir=self.parent.TEMPDIR) - with open(tmpscript,'w') as f : - f.write(txt) - exec_rcode(self.parent.RPath, tmpscript, wait = True) - win = MessageImage(self, u"Graphique", size=(700, 500)) - win.addsaveimage(tmpgraph) - txt = "" % tmpgraph - win.HtmlPage.SetPage(txt) - win.Show(True) + BarFrame(self.parent, table, colnames, rownames) def OnTgen_glob(self, evt) : activenotebook = self.parent.nb.GetSelection()