diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-19 19:36:05 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-19 19:36:17 +0200 |
commit | 873f91be7d3316e93672731e2f3d2da02b41fca6 (patch) | |
tree | 5a12d1a5ac1f0a4aa5fca9ab9e6b86e64f25e388 /pyload/datatypes/PyFile.py | |
parent | Explain how to add tips for translators (diff) | |
download | pyload-873f91be7d3316e93672731e2f3d2da02b41fca6.tar.xz |
new plugin type and refactored request classes
Diffstat (limited to 'pyload/datatypes/PyFile.py')
-rw-r--r-- | pyload/datatypes/PyFile.py | 16 |
1 files changed, 9 insertions, 7 deletions
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: |