diff options
author | mkaay <mkaay@mkaay.de> | 2010-12-12 17:45:40 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-12-12 17:45:40 +0100 |
commit | ddc6c0c15c132933e9676d563bad37288a3212f5 (patch) | |
tree | a5d6ecbcc4b96be9f8aead14262f3aa3ec69a5df /module/network/FtpRequest.py | |
parent | fixed progress when resuming (diff) | |
download | pyload-ddc6c0c15c132933e9676d563bad37288a3212f5.tar.xz |
universal progress (ex. unrar progress), link info now emits update event, updated .pot
Diffstat (limited to 'module/network/FtpRequest.py')
-rw-r--r-- | module/network/FtpRequest.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/network/FtpRequest.py b/module/network/FtpRequest.py index d8f556fea..a0986a9ed 100644 --- a/module/network/FtpRequest.py +++ b/module/network/FtpRequest.py @@ -54,6 +54,7 @@ class FtpRequest: self.averageSpeeds = [] self.averageSpeedTime = 0.0 self.averageSpeedCount = 0.0 + self.progressNotify = None self.speedLimitActive = False self.maxSpeed = 0 @@ -219,8 +220,15 @@ class FtpRequest: def progress(self, dl_t, dl_d, up_t, up_d): if self.abort: return False - self.dl_arrived = int(dl_d) - self.dl_size = int(dl_t) + self.dl_arrived = int(dl_d)+self.offset + self.dl_size = int(dl_t)+self.offset + + if self.progressNotify: + try: + progress = int(float(self.dl_arrived)/self.dl_size*100) + self.progressNotify(progress) + except: + pass def get_free_name(self, file_name): file_count = 0 |