diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-25 14:38:21 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-25 14:38:21 +0000 |
| commit | f5ffcecfc7630c019641e45c2185ef058e62e1a4 (patch) | |
| tree | 612a0eb944baa1eef1f0fc1096984c4f104a8ee2 /apt/progress.py | |
| parent | 5ba2ebc40f8137df28c07b52ab76e7c3d4352e8d (diff) | |
| download | python-apt-f5ffcecfc7630c019641e45c2185ef058e62e1a4.tar.gz | |
* added a native OpTextProgress()
Diffstat (limited to 'apt/progress.py')
| -rw-r--r-- | apt/progress.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apt/progress.py b/apt/progress.py index ae5706af..98493c92 100644 --- a/apt/progress.py +++ b/apt/progress.py @@ -1,5 +1,6 @@ class OpProgress: + """ Abstract class to implement reporting on cache opening """ def __init__(self): pass def Update(self, percent): @@ -7,6 +8,18 @@ class OpProgress: def Done(self): pass +class OpTextProgress(OpProgress): + """ A simple text based cache open reporting class """ + def __init__(self): + OpProgress.__init__(self) + def Update(self, percent): + sys.stdout.write("\r%s: %.2i " % (self.Op,percent)) + sys.stdout.flush() + def Done(self): + sys.stdout.write("\r%s: Done\n" % self.Op) + + + class FetchProgress: def __init__(self): pass |
