diff options
| author | jak@debian.org <> | 2009-06-08 16:55:53 +0200 |
|---|---|---|
| committer | jak@debian.org <> | 2009-06-08 16:55:53 +0200 |
| commit | 857774704739c39a68a1e72914a82e001e62ec93 (patch) | |
| tree | cb39aa37776079b57f678af04e65ee0c6e109b1d /apt/progress | |
| parent | 6c4e35354bba110758d9009e1555b2e13cd5ce4f (diff) | |
| parent | 1b5b026c1013dc20b572a7fd2a690fe451248ab0 (diff) | |
| download | python-apt-857774704739c39a68a1e72914a82e001e62ec93.tar.gz | |
merge with mvo
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 6e4c6eec..47d2a861 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -116,6 +116,13 @@ class FetchProgress(object): This happens eg. when the downloads fails or is completed. """ + def update_status_full(self, uri, descr, short_descr, status, file_size, + partial_size): + """Called when the status of an item changes. + + This happens eg. when the downloads fails or is completed. This + version include information on current filesize and partial size + """ def pulse(self): """Called periodically to update the user interface. @@ -129,6 +136,19 @@ class FetchProgress(object): float(self.current_cps)) return True + def pulse_items(self, items): + """Called periodically to update the user interface. + This function includes details about the items being fetched + Return True to continue or False to cancel. + + """ + self.percent = (((self.current_bytes + self.current_items) * 100.0) / + float(self.total_bytes + self.total_items)) + if self.current_cps > 0: + self.eta = ((self.total_bytes - self.current_bytes) / + float(self.current_cps)) + return True + def media_change(self, medium, drive): """react to media change events.""" |
