equal
deleted
inserted
replaced
117 add = '' |
117 add = '' |
118 if indicator == 'topic': |
118 if indicator == 'topic': |
119 add = topic |
119 add = topic |
120 elif indicator == 'number': |
120 elif indicator == 'number': |
121 if total: |
121 if total: |
122 padamount = '%d' % len(str(total)) |
122 add = b'%*d/%d' % (len(str(total)), 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) |
|
128 else: |
123 else: |
129 add = str(pos) |
124 add = str(pos) |
130 elif indicator.startswith('item') and item: |
125 elif indicator.startswith('item') and item: |
131 slice = 'end' |
126 slice = 'end' |
132 if '-' in indicator: |
127 if '-' in indicator: |