1 #Definicion para ordernar la lista 2 def newList(self, widge): 3 var = self.combolist.get_active() 4 5 #Si se activa Aleatorio 6 if var == 0: 7 n = 0 8 for musicfiles in self.medialist: 9 n += 1 10 index = range(0, n) 11 shuffle(index) 12 #Reorganiza la lista de musica llamad medialist 13 if len(index) > 1: 14 self.medialist.reorder(index) 15 16 #Si se activa Alfabetico 17 if var == 1: 18 iter=self.medialist.get_iter_first() 19 newlistfiles = [] 20 while iter: 21 files = self.medialist.get_value(iter,0) 22 source = self.medialist.get_value(iter,1) 23 newlistfiles.append([files,source]) 24 iter = self.medialist.iter_next(iter) 25 newlistfiles = sorted(newlistfiles) 26 self.medialist.clear() 27 for files,source in newlistfiles: 28 self.medialist.append([files,source])