1 #Definicion del comando Guardar Permite guardar una lista 2 def showSave(self, widget): 3 self.filterbox.set_name("Lista Multimedia") 4 self.filterbox.add_pattern("*.pls") 5 self.save.add_filter(self.filterbox) 6 respt = self.save.run() 7 self.save.remove_filter(self.filterbox) 8 self.save.hide() 9 10 if respt == -5: 11 n = 0 12 filename = self.save.get_filename() 13 playlistsaved = open(filename + '.pls', 'w') 14 playlistsaved.write("[playlist]" + "\n") 15 16 iter=self.medialist.get_iter_first() 17 18 while iter: 19 n+=1 20 allmusicfiles1 = self.medialist.get_value(iter,1) 21 allmusicfiles2 = self.medialist.get_value(iter,0) 22 allmusicfiles = allmusicfiles1+"/"+allmusicfiles2 23 pathname = urllib.pathname2url(os.path.abspath(allmusicfiles)) 24 playlistsaved.write("File"+str(n)+"=file://"+pathname.encode('utf-8') + "\n") 25 iter = self.medialist.iter_next(iter)