From 979daf6a4daae605b2a39e916c16015437fac98d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 12 Jun 2009 15:36:48 +0200 Subject: little fixes --- Core.py | 4 ++++ module/download_thread.py | 4 +++- module/thread_list.py | 2 +- pyMainGui.py | 6 ++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Core.py b/Core.py index 1d1114878..1b19d17d9 100644 --- a/Core.py +++ b/Core.py @@ -179,9 +179,13 @@ class Core(object): list = [] for pyfile in self.thread_list.py_downloading: download = {} + download['id'] = pyfile.id download['name'] = pyfile.status.filename download['speed'] = pyfile.status.get_speed() download['eta'] = pyfile.status.get_ETA() + download['kbleft'] = pyfile.status.kB_left() + download['size'] = pyfile.status.size() + download['status'] = pyfile.status.type list.append(download) return list diff --git a/module/download_thread.py b/module/download_thread.py index f4530c3b3..bb32030a7 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -40,7 +40,9 @@ class Status(object): def get_speed(self): return self.pyfile.plugin.req.get_speed() def kB_left(self): - return self.pyfile.plugins.req.kB_left() + return self.pyfile.plugin.req.kB_left() + def size(self): + return self.pyfile.plugin.req.dl_size / 1024 class Download_Thread(threading.Thread): diff --git a/module/thread_list.py b/module/thread_list.py index 850e738db..bfe99c6e2 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -32,7 +32,7 @@ class Thread_List(object): def __init__(self, parent): self.parent = parent self.threads = [] - self.max_threads = self.parent.config['max_downloads'] + self.max_threads = int(self.parent.config['max_downloads']) self.py_load_files = [] # files in queque self.f_relation = [0, 0] self.lock = RLock() diff --git a/pyMainGui.py b/pyMainGui.py index d88242826..1342ed8f1 100755 --- a/pyMainGui.py +++ b/pyMainGui.py @@ -146,10 +146,12 @@ class Pyload_Main_Gui(wx.Frame): def onUpdate(self, evt): if evt.obj.function == "get_downloads": - self.show_links(evt.obj.response) + pass + #self.show_links(evt.obj.response) if evt.obj.command == "update": - self.show_links(evt.obj.data) + pass + #self.show_links(evt.obj.data) app = wx.App() Pyload_Main_Gui(None, -1) -- cgit v1.2.3