summaryrefslogtreecommitdiff
path: root/shellutils.py
diff options
context:
space:
mode:
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 dd9207f..70f5c4b 100644
--- a/shellutils.py
+++ b/shellutils.py
@@ -193,7 +193,7 @@ class ProgressBar(object):
def __init__(self, nbops, size=20., stream=sys.stdout):
self._dotevery = max(nbops / size, 1)
- self._fstr = '\r[%-20s]'
+ self._fstr = '\r[%%-%ss]' % size
self._dotcount, self._dots = 1, []
self._stream = stream
@@ -201,7 +201,7 @@ class ProgressBar(object):
"""update the progression bar"""
self._dotcount += 1
if self._dotcount >= self._dotevery:
- self._dotcount = 1
+ self._dotcount = 0
self._dots.append('.')
self._stream.write(self._fstr % ''.join(self._dots))
self._stream.flush()