diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-02 18:29:19 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-02 18:29:19 +0200 |
commit | 2196301c392aa6ff7f8a4392fec903792b62dc9c (patch) | |
tree | 90ca186c63d1df54af074e03f84722cf512bab59 /pyLoadCore.py | |
parent | setup working (diff) | |
download | pyload-2196301c392aa6ff7f8a4392fec903792b62dc9c.tar.xz |
webif: log+download page
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index 02975ad2f..bfc575b94 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -421,7 +421,7 @@ class ServerMethods(): def get_conf_val(self, cat, var): """ get config value """ - return self.config[cat][var] + return self.core.config[cat][var] def set_conf_val(self, cat, opt, val): """ set config value """ @@ -539,25 +539,23 @@ class ServerMethods(): def get_log(self, offset=0): filename = join(self.core.config['log']['log_folder'], 'log.txt') fh = open(filename, "r") - content = fh.read() + lines = fh.readlines() fh.close() - lines = content.splitlines() + lines.reverse() if offset >= len(lines): return None + return lines[offset:] def stop_downloads(self): - #@TODO implement - self.core.thread_list.stopAllDownloads() + pyfiles = self.files.cache.values() + + for pyfile in pyfiles: + pyfile.abortDownload() def stop_download(self, type, id): - #@TODO implement - if type == "pack": - ids = self.core.file_list.getPackageFiles(id) - for fid in ids: - self.core.file_list.packager.abortFile(fid) - else: - self.core.file_list.packager.abortFile(id) + if self.core.files.cache.has_key(id): + self.core.files.cache[id].abortDownload() def set_package_name(self, pid, name): |