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 | |
| parent | 2a0f97e8ad0ed8ac7456b8dc785071bf1c3a1847 (diff) | |
| download | python-apt-30bde83a45ebe2b8c401ef72f8bac3f4058614ab.tar.gz | |
apt.progress: Use long for ETA, natural type for size (LP: #377375)
| -rw-r--r-- | apt/progress/old.py | 5 | ||||
| -rw-r--r-- | apt/progress/text.py | 5 | ||||
| -rw-r--r-- | debian/changelog | 1 |
3 files changed, 6 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)) diff --git a/debian/changelog b/debian/changelog index 2272462a..4d5c6225 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.8.0~exp2) UNRELEASED; urgency=low * apt_pkg: Raise error when parse_commandline gets empty argv (LP: #707416) * apt_pkg: Fix time_to_str, time_rfc1123 to accept more correct values (time_to_str accepts unsigned long, time_rfc1123 long long, y2k31-correct). + * apt.progress: Use long for ETA, natural type for size (LP: #377375) -- Julian Andres Klode <jak@debian.org> Wed, 06 Apr 2011 09:46:52 +0200 |
