+ self.them_mod = {}
+ self.ira = wx.GetApp().GetTopWindow()
+ line1 = profclasse.pop(0)
+ classen = [line for line in profclasse if line[0] != '*' and line[0] != '*****']
+ try :
+ self.lenact = profclasse.index(['*****', '*', '*', '*', '*', '*', '', ''])
+ profclasse.pop(self.lenact)
+ except ValueError:
+ try :
+ self.lenact = profclasse.index(['*', '*', '*', '*', '*', '*', '', ''])
+ profclasse.pop(self.lenact)
+ except ValueError:
+ self.lenact = len(profclasse)
+ try :
+ self.lensup = profclasse.index(['*', '*', '*', '*', '*', '*', '', ''])
+ self.lensup = self.lensup - self.lenact
+ profclasse.pop(self.lensup)
+ except ValueError:
+ self.lensup = len(profclasse) - self.lenact
+ self.lenet = len(profclasse) - (self.lenact + self.lensup)
+# print self.lenact, self.lensup, self.lenet
+ for i, line in enumerate(classen) :
+ line[0] = i
+ dictdata = dict(list(zip([i for i in range(0,len(classen))], classen)))
+ if self.lenact != 0 :
+ self.la = [dictdata[i][6] for i in range(0, self.lenact)]
+ self.lchi = [dictdata[i][4] for i in range(0, self.lenact)]
+ self.lfreq = [dictdata[i][1] for i in range(0, self.lenact)]
+ else :
+ self.la = []
+ self.lchi = []
+ self.lfreq = []
+ self.tmpchi = None
+ #adding some art
+ self.il = wx.ImageList(16, 16)
+ a={"sm_up":"GO_UP","sm_dn":"GO_DOWN","w_idx":"WARNING","e_idx":"ERROR","i_idx":"QUESTION"}
+ for k,v in list(a.items()):
+ s="self.%s= self.il.Add(wx.ArtProvider.GetBitmap(wx.ART_%s,wx.ART_TOOLBAR,(16,16)))" % (k,v)
+ exec(s)
+ self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
+ #adding some attributes (colourful background for each item rows)
+ self.attr1 = wx.ListItemAttr()
+ self.attr1.SetBackgroundColour((220, 220, 220))
+ self.attrsg = wx.ListItemAttr()
+ self.attrsg.SetBackgroundColour((230, 230, 230))
+ self.attr2 = wx.ListItemAttr()
+ self.attr2.SetBackgroundColour((190, 249, 236))
+ self.attr2s = wx.ListItemAttr()
+ self.attr2s.SetBackgroundColour((211, 252, 244))
+ self.attr3 = wx.ListItemAttr()
+ self.attr3.SetBackgroundColour((245, 180, 180))
+ self.attr3s = wx.ListItemAttr()
+ self.attr3s.SetBackgroundColour((245, 190, 190))
+ self.InsertColumn(0, "num", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(1, "eff. s.t.", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(2, "eff. total", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(3, "pourcentage", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(4, "chi2", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(5, "Type", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(6, "forme", wx.LIST_FORMAT_RIGHT)
+ self.InsertColumn(7, "p", wx.LIST_FORMAT_RIGHT)
+ self.SetColumnWidth(0, 60)
+ self.SetColumnWidth(1, 100)
+ self.SetColumnWidth(2, 100)
+ self.SetColumnWidth(3, 120)
+ self.SetColumnWidth(4, 150)
+ self.SetColumnWidth(5, 100)
+ self.SetColumnWidth(6, 300)
+ self.SetColumnWidth(7, wx.LIST_AUTOSIZE)
+ #These two should probably be passed to init more cleanly
+ #setting the numbers of items = number of elements in the dictionary
+ self.itemDataMap = dictdata
+ self.itemIndexMap = list(dictdata.keys())
+ self.SetItemCount(len(dictdata))
+ #mixins
+ listmix.ListCtrlAutoWidthMixin.__init__(self)
+ listmix.ColumnSorterMixin.__init__(self, len(classen[0]))
+ self.SortListItems(0, True)
+ #sort by genre (column 2), A->Z ascending order (1)
+