summaryrefslogtreecommitdiffstats
path: root/module/file_list.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/file_list.py')
-rw-r--r--module/file_list.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/module/file_list.py b/module/file_list.py
index e9a836dbc..a25e954a5 100644
--- a/module/file_list.py
+++ b/module/file_list.py
@@ -90,7 +90,22 @@ class File_List(object):
id += 1
return id
+
+ def move(self, id, offset=-1):
+ for pyfile in self.files:
+ if pyfile.id == id:
+ index = self.files.index(pyfile)
+ pyfile = self.files.pop(index)
+ self.files.insert(index + offset, pyfile)
+ break
+
+
+ index = self.data['order'].index(id)
+ pyfile = self.data['order'].pop(index)
+ self.data['order'].insert(index + offset, pyfile)
+
+
def save(self):
self.lock.acquire()