Show More
@@ -120,7 +120,11 b' class progbar(object):' | |||||
120 | elif indicator == 'number': |
|
120 | elif indicator == 'number': | |
121 | if total: |
|
121 | if total: | |
122 | padamount = '%d' % len(str(total)) |
|
122 | padamount = '%d' % len(str(total)) | |
123 | add = ('% '+ padamount + 's/%s') % (pos, total) |
|
123 | # '% 1d' % 1 adds an extra space compared to '% 1s' % 1. | |
|
124 | # To avoid this change in output, we convert to a string | |||
|
125 | # first, then do the padding. | |||
|
126 | spos = '%d' % pos | |||
|
127 | add = ('% '+ padamount + 's/%d') % (spos, total) | |||
124 | else: |
|
128 | else: | |
125 | add = str(pos) |
|
129 | add = str(pos) | |
126 | elif indicator.startswith('item') and item: |
|
130 | elif indicator.startswith('item') and item: |
General Comments 0
You need to be logged in to leave comments.
Login now