X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=listlex.py;h=9ddd16bd419e9c15248b815a645bc5c56f096f01;hp=5f22405e843f4811bd110ce1e0cfb3f7ac3a7953;hb=9ba3d2c5c6c49439c8b2ff4ae6bd7a632146850a;hpb=a38c33bb022324119c865d990e7ef1f087c24780 diff --git a/listlex.py b/listlex.py index 5f22405..9ddd16b 100644 --- a/listlex.py +++ b/listlex.py @@ -16,12 +16,11 @@ import os import sys 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 #--------------------------------------------------------------------------- @@ -42,7 +41,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,14 +67,14 @@ 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 self.SetColumnWidth(0, 180) - for i in range(0,len(self.first)): - self.SetColumnWidth(i + 1, self.checkcolumnwidth(len(self.first[i]) * 10)) + for i in range(0,len(self.etoiles)): + self.SetColumnWidth(i + 1, self.checkcolumnwidth(len(self.etoiles[i]) * 10)) self.itemDataMap = self.dlist self.itemIndexMap = self.dlist.keys() @@ -230,9 +228,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 +316,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()