From 873f91be7d3316e93672731e2f3d2da02b41fca6 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 19 Jul 2013 19:36:05 +0200 Subject: new plugin type and refactored request classes --- pyload/datatypes/PyFile.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'pyload/datatypes/PyFile.py') diff --git a/pyload/datatypes/PyFile.py b/pyload/datatypes/PyFile.py index ba5208795..7bb3a4e31 100644 --- a/pyload/datatypes/PyFile.py +++ b/pyload/datatypes/PyFile.py @@ -202,8 +202,10 @@ class PyFile(object): sleep(0.1) self.abort = False - if self.plugin and self.plugin.req: - self.plugin.req.abortDownloads() + if self.plugin: + self.plugin.req.abort() + if self.plugin.dl: + self.plugin.dl.abort() self.release() @@ -224,7 +226,7 @@ class PyFile(object): def getSpeed(self): """ calculates speed """ try: - return self.plugin.req.speed + return self.plugin.dl.speed except: return 0 @@ -241,22 +243,22 @@ class PyFile(object): def getBytesArrived(self): """ gets bytes arrived """ try: - return self.plugin.req.arrived + return self.plugin.dl.arrived except: return 0 def getBytesLeft(self): """ gets bytes left """ try: - return self.plugin.req.size - self.plugin.req.arrived + return self.plugin.dl.size - self.plugin.dl.arrived except: return 0 def getSize(self): """ get size of download """ try: - if self.plugin.req.size: - return self.plugin.req.size + if self.plugin.dl.size: + return self.plugin.dl.size else: return self.size except: -- cgit v1.2.3