diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-27 20:59:11 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-27 20:59:11 +0200 |
commit | 070e7152727f8e04910df30bf1d7a92f90a9613f (patch) | |
tree | e17fc21bb3797a17122bff7dc65969ce3dfe6cd8 /module | |
parent | gui displays downloads (diff) | |
download | pyload-070e7152727f8e04910df30bf1d7a92f90a9613f.tar.xz |
basic gui functions are working
Diffstat (limited to 'module')
-rw-r--r-- | module/file_list.py | 15 |
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() |