X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=Liste.py;h=737120e2834fe911eec128cc8094d9a121ead908;hp=e0bc11a6167d5fe1a0eb3b477fd55eeabe84b55a;hb=6919f2ef8d85c176c7be824b606c4b71142e10fd;hpb=ab4c9b7b0ac41c8a5e910caff895a5486f80188b diff --git a/Liste.py b/Liste.py index e0bc11a..737120e 100644 --- a/Liste.py +++ b/Liste.py @@ -19,7 +19,7 @@ import wx from dialog import SearchDial, message import wx.lib.mixins.listctrl as listmix from operator import itemgetter - +from functions import doconcorde #--------------------------------------------------------------------------- class ListPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorterMixin): @@ -71,6 +71,7 @@ class ListPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorte self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self) self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self) + self.Bind(wx.EVT_LIST_ITEM_ACTIVATED , self.OnPopupTwo, self) # for wxMSW self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick) @@ -173,7 +174,7 @@ class ListPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorte lems = corpus.getlems() rep = [] for forme in lems[word].formes : - rep.append([corpus.getforme(forme).forme, corpus.getforme(forme).freq]) + 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' @@ -182,20 +183,12 @@ class ListPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorte def OnPopupTwo(self, event): corpus = self.gparent.corpus - win = message(self, u"Concordancier", (750, 600)) - avap = 60 item = self.getColumnText(self.GetFirstSelected(), 0) - listmot = corpus.getlems()[item].formes - #uce_ok = [corpus.formes[corpus.idformes[forme].forme][1] for forme in listmot] - uce_ok = corpus.getlemuces(item)#list(set([tuple(val) for line in uce_ok for val in line])) - txt = '

Concordancier

' - res = corpus.getconcorde(uce_ok) - for uce in res : - ucetxt = ' '+uce[1]+' ' - txt += ' '.join(corpus.ucis[corpus.getucefromid(uce[0]).uci].etoiles) + '
' - for forme in listmot : - forme = corpus.getforme(forme).forme - ucetxt = ucetxt.replace(' '+forme+' ', ' ' + forme + ' ') - txt += ucetxt + '

' - win.HtmlPage.SetPage(txt) + uce_ok = corpus.getlemuces(item) + ucis_txt, ucestxt = doconcorde(corpus, uce_ok, [item]) + items = dict([[i, '

'.join([ucis_txt[i], ucestxt[i]])] for i in range(0,len(ucestxt))]) + win = message(self, items, u"Concordancier - %s" % item, (800, 500)) + #win = message(self, u"Concordancier", (750, 600)) + #win.html = ('\n

%s

' % item) + '
'.join(['
'.join([ucis_txt[i], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n' + #win.HtmlPage.SetPage(win.html) win.Show(True)