1 #Definicion del comando Arriba y Abajo 2 def updown_move(self, button): 3 line = self.treeview.get_selection() 4 (model, rows) = line.get_selected_rows() 5 if button == self.up: 6 for path1 in rows: 7 path2 = int(str(path1))-1 8 if path2 < 0: 9 return 10 else: 11 iter1 = model.get_iter(path1) 12 iter2 = model.get_iter(path2) 13 model.swap(iter1,iter2) 14 15 if button == self.down: 16 for path1 in rows: 17 iter1 = model.get_iter(path1) 18 iter2 = model.iter_next(iter1) 19 if iter2 == None: 20 return 21 else: 22 model.swap(iter1,iter2)