From faf6fbc956f8c23871c0bcb91a84986ffd689201 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 5 Oct 2010 20:07:44 +0200 Subject: changed dl function for test purpose --- module/network/Request.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/network') diff --git a/module/network/Request.py b/module/network/Request.py index f5c856f6f..21159dde1 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -287,8 +287,9 @@ class Request: self.chunkRead += chunkSize self.dl_arrived += chunkSize - self.pycurl.setopt(pycurl.WRITEFUNCTION, writefunc) - + #self.pycurl.setopt(pycurl.WRITEFUNCTION, writefunc) + self.pycurl.setopt(pycurl.WRITEDATA, self.fp) + try: self.pycurl.perform() except Exception, e: @@ -344,7 +345,8 @@ class Request: def get_speed(self): try: - return self.dl_speed + #return self.dl_speed + return (self.dl_arrived / (time.time()- self.dl_time)) / 1024 except: return 0 -- cgit v1.2.3