diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-08-05 09:23:13 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-08-05 09:23:13 +0000 |
| commit | de457bf476143b1f617378c7215503b777a743cc (patch) | |
| tree | 71fabade43f9add41f6f1423fe39418b06c0d5bf /doc/examples/progress.py | |
| parent | 698f8ba826e01386be5de57bc95b44a5f22454dd (diff) | |
| download | python-apt-de457bf476143b1f617378c7215503b777a743cc.tar.gz | |
* improved the examples, added README too
Diffstat (limited to 'doc/examples/progress.py')
| -rw-r--r-- | doc/examples/progress.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/examples/progress.py b/doc/examples/progress.py index e2ff97e2..d820fcb2 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -1,4 +1,5 @@ import apt +from apt import SizeToStr import sys import time import string @@ -32,7 +33,8 @@ class TextFetchProgress(apt.FetchProgress): def updateStatus(self, uri, descr, shortDescr, status): print "UpdateStatus: '%s' '%s' '%s' '%i'" % (uri,descr,shortDescr, status) def pulse(self): - print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % (apt_pkg.SizeToStr(self.currentCPS), apt_pkg.SizeToStr(self.currentBytes), apt_pkg.SizeToStr(self.totalBytes), self.currentItems, self.totalItems) + print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % (SizeToStr(self.currentCPS), SizeToStr(self.currentBytes), SizeToStr(self.totalBytes), self.currentItems, self.totalItems) + return True def mediaChange(self, medium, drive): print "Please insert medium %s in drive %s" % (medium, drive) |
