diff options
| author | Stephan Peijnik <debian@sp.or.at> | 2009-05-06 22:57:42 +0200 |
|---|---|---|
| committer | Stephan Peijnik <debian@sp.or.at> | 2009-05-06 22:57:42 +0200 |
| commit | 80f3ac59823b31be89dcb52b5ba38aa27d48121f (patch) | |
| tree | 521023c930ce6d98962beb7c6737e90a28dc9261 /doc/examples/progress.py | |
| parent | c639dfe4d9c77bf7406bb6e4b433c297d293f709 (diff) | |
| parent | 1b5b026c1013dc20b572a7fd2a690fe451248ab0 (diff) | |
| download | python-apt-80f3ac59823b31be89dcb52b5ba38aa27d48121f.tar.gz | |
Merged with lp:python-apt.
Diffstat (limited to 'doc/examples/progress.py')
| -rw-r--r-- | doc/examples/progress.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/doc/examples/progress.py b/doc/examples/progress.py index f7650f69..c007681f 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -34,12 +34,22 @@ class TextFetchProgress(apt.FetchProgress): def stop(self): pass - def updateStatus(self, uri, descr, shortDescr, status, fileSize, - partialSize): - print "UpdateStatus: '%s' '%s' '%s' '%i' '%d/%d'" % ( + def updateStatus(self, uri, descr, shortDescr, status): + print "UpdateStatus: '%s' '%s' '%s' '%i' " % ( + uri, descr, shortDescr, status) + + def update_status_full(self, uri, descr, shortDescr, status, fileSize, + partialSize): + print "update_status_full: '%s' '%s' '%s' '%i' '%d/%d'" % ( uri, descr, shortDescr, status, partialSize, fileSize) - def pulse(self, items): + def pulse(self): + print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % ( + apt.SizeToStr(self.currentCPS), apt.SizeToStr(self.currentBytes), + apt.SizeToStr(self.totalBytes), self.currentItems, self.totalItems) + return True + + def pulse_items(self, items): print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % ( apt.SizeToStr(self.currentCPS), apt.SizeToStr(self.currentBytes), apt.SizeToStr(self.totalBytes), self.currentItems, self.totalItems) @@ -47,7 +57,7 @@ class TextFetchProgress(apt.FetchProgress): for itm in items: uri, descr, shortDescr, fileSize, partialSize = itm print " - '%s' '%s' '%s' '%d/%d'" % ( - uri, descr, shortDescr, partialSize, fileSize + uri, descr, shortDescr, partialSize, fileSize) return True def mediaChange(self, medium, drive): |
