diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-11 11:54:15 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-11 11:54:15 +0200 |
| commit | 30bde83a45ebe2b8c401ef72f8bac3f4058614ab (patch) | |
| tree | fd4e6cc5e82beaa027bbd2ea4472e0875355cb25 /apt/progress | |
| parent | 2a0f97e8ad0ed8ac7456b8dc785071bf1c3a1847 (diff) | |
| download | python-apt-30bde83a45ebe2b8c401ef72f8bac3f4058614ab.tar.gz | |
apt.progress: Use long for ETA, natural type for size (LP: #377375)
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/old.py | 5 | ||||
| -rw-r--r-- | apt/progress/text.py | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/apt/progress/old.py b/apt/progress/old.py index 4bd79f2e..364cd2ce 100644 --- a/apt/progress/old.py +++ b/apt/progress/old.py @@ -149,10 +149,11 @@ class TextFetchProgress(FetchProgress): Return True to continue or False to cancel. """ FetchProgress.pulse(self) + if self.currentCPS > 0: s = "[%2.f%%] %sB/s %s" % (self.percent, - apt_pkg.size_to_str(int(self.currentCPS)), - apt_pkg.time_to_str(int(self.eta))) + apt_pkg.size_to_str(self.currentCPS), + apt_pkg.time_to_str(long(self.eta))) else: s = "%2.f%% [Working]" % (self.percent) print "\r%s" % (s), diff --git a/apt/progress/text.py b/apt/progress/text.py index d777837c..c5eec092 100644 --- a/apt/progress/text.py +++ b/apt/progress/text.py @@ -157,11 +157,10 @@ class AcquireProgress(base.AcquireProgress, TextProgress): shown = False tval = '%i%%' % percent - end = "" if self.current_cps: - eta = int(float(self.total_bytes - self.current_bytes) / - self.current_cps) + eta = long(float(self.total_bytes - self.current_bytes) / + self.current_cps) end = " %sB/s %s" % (apt_pkg.size_to_str(self.current_cps), apt_pkg.time_to_str(eta)) |
