summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/progress.py b/progress.py
index 1eff04ac..d2ed4bae 100644
--- a/progress.py
+++ b/progress.py
@@ -39,7 +39,7 @@ class Progress(object):
39 self._print_newline = print_newline 39 self._print_newline = print_newline
40 self._always_print_percentage = always_print_percentage 40 self._always_print_percentage = always_print_percentage
41 41
42 def update(self, inc=1): 42 def update(self, inc=1, msg=''):
43 self._done += inc 43 self._done += inc
44 44
45 if _NOT_TTY or IsTrace(): 45 if _NOT_TTY or IsTrace():
@@ -62,12 +62,13 @@ class Progress(object):
62 62
63 if self._lastp != p or self._always_print_percentage: 63 if self._lastp != p or self._always_print_percentage:
64 self._lastp = p 64 self._lastp = p
65 sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s)%s' % ( 65 sys.stderr.write('%s\r%s: %3d%% (%d%s/%d%s)%s%s%s' % (
66 CSI_ERASE_LINE, 66 CSI_ERASE_LINE,
67 self._title, 67 self._title,
68 p, 68 p,
69 self._done, self._units, 69 self._done, self._units,
70 self._total, self._units, 70 self._total, self._units,
71 ' ' if msg else '', msg,
71 "\n" if self._print_newline else "")) 72 "\n" if self._print_newline else ""))
72 sys.stderr.flush() 73 sys.stderr.flush()
73 74