summaryrefslogtreecommitdiff
path: root/shellutils.py
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 16:14:40 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 16:14:40 +0200
commitd5bf80bf6e82204f338c51cb7d16d2db0c74c47f (patch)
treecf72763a29ea2bd78024165407b7271eeb61e217 /shellutils.py
parenta1cdde3320add8bbe4557639488bb4d2ef2861fd (diff)
downloadlogilab-common-d5bf80bf6e82204f338c51cb7d16d2db0c74c47f.tar.gz
#9764: add title to shellutils.ProgressBar
Diffstat (limited to 'shellutils.py')
-rw-r--r--shellutils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/shellutils.py b/shellutils.py
index 67e9ab6..a8f216d 100644
--- a/shellutils.py
+++ b/shellutils.py
@@ -257,8 +257,8 @@ def release_lock(lock_file):
class ProgressBar(object):
"""A simple text progression bar."""
- def __init__(self, nbops, size=20, stream=sys.stdout):
- self._fstr = '\r[%%-%ss]' % int(size)
+ def __init__(self, nbops, size=20, stream=sys.stdout, title=''):
+ self._fstr = '\r%s[%%-%ss]' % (title, int(size))
self._stream = stream
self._total = nbops
self._size = size