X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=listlex.py;h=c3a723468936dd99da399cee931029395175ba13;hp=9ead606552762cceae9ccaac18fb7f037b7cb612;hb=342d693d835ba1077fe0f31824664a807cafa3bb;hpb=e531d59ce2d8f72dfc3138446db913af1f20b134;ds=sidebyside diff --git a/listlex.py b/listlex.py index 9ead606..c3a7234 100644 --- a/listlex.py +++ b/listlex.py @@ -22,14 +22,9 @@ from functions import exec_rcode, MessageImage from chemins import ffr from PrintRScript import barplot from dialog import SearchDial, message +from operator import itemgetter #--------------------------------------------------------------------------- -#class List(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): -# def __init__(self, parent, ID, pos=wx.DefaultPosition, -# size=wx.DefaultSize, style=0): -# wx.ListCtrl.__init__(self, parent, ID, pos, size, style) -# listmix.ListCtrlAutoWidthMixin.__init__(self) - class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorterMixin): def __init__(self, parent,gparent, dlist, first, menu = True): wx.ListCtrl.__init__( self, parent, -1, style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_HRULES|wx.LC_VRULES) @@ -192,6 +187,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor rep = [] 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) @@ -281,41 +277,3 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor txt = "" % tmpgraph win.HtmlPage.SetPage(txt) win.Show(True) - - - -#class message(wx.Frame): -# def __init__(self, *args, **kwds): -# # begin wxGlade: MyFrame.__init__ -# kwds["style"] = wx.DEFAULT_FRAME_STYLE -# wx.Frame.__init__(self, *args, **kwds) -# #self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE) -# self.HtmlPage=wx.html.HtmlWindow(self, -1) -# if "gtk2" in wx.PlatformInfo: -# self.HtmlPage.SetStandardFonts() -# self.HtmlPage.SetFonts('Courier','Courier') -# -# -# self.button_1 = wx.Button(self, -1, "Fermer") -# self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1) -# self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) -# self.__do_layout() -# # end wxGlade -# -# def __do_layout(self): -# # begin wxGlade: MyFrame.__do_layout -# sizer_1 = wx.BoxSizer(wx.VERTICAL) -# sizer_2 = wx.BoxSizer(wx.VERTICAL) -# sizer_2.Add(self.HtmlPage, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) -# sizer_2.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0) -# sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) -# self.SetAutoLayout(True) -# self.SetSizer(sizer_1) -# self.Layout() -# # end wxGlade -# -# def OnCloseMe(self, event): -# self.Close(True) -# -# def OnCloseWindow(self, event): -# self.Destroy()