From f5ffcecfc7630c019641e45c2185ef058e62e1a4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 25 May 2005 14:38:21 +0000 Subject: * added a native OpTextProgress() --- apt/progress.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apt') 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 -- cgit v1.2.3