##// END OF EJS Templates
progress: use 'encoding.colwidth' to get column width of items correctly...
FUJIWARA Katsunori -
r21863:f9c91c63 default
parent child Browse files
Show More
@@ -142,7 +142,7 b' class progbar(object):'
142 add = encoding.trim(item, wid, leftside=True)
142 add = encoding.trim(item, wid, leftside=True)
143 else:
143 else:
144 add = encoding.trim(item, wid)
144 add = encoding.trim(item, wid)
145 add += (wid - len(add)) * ' '
145 add += (wid - encoding.colwidth(add)) * ' '
146 elif indicator == 'bar':
146 elif indicator == 'bar':
147 add = ''
147 add = ''
148 needprogress = True
148 needprogress = True
@@ -304,6 +304,7 b' from each other.'
304 $ cat >> loop.py <<EOF
304 $ cat >> loop.py <<EOF
305 > # use non-ascii characters as loop items of progress
305 > # use non-ascii characters as loop items of progress
306 > loopitems = [
306 > loopitems = [
307 > u'\u3042\u3044'.encode('utf-8'), # 2 x 2 = 4 columns
307 > u'\u3042\u3044\u3046'.encode('utf-8'), # 2 x 3 = 6 columns
308 > u'\u3042\u3044\u3046'.encode('utf-8'), # 2 x 3 = 6 columns
308 > u'\u3042\u3044\u3046\u3048'.encode('utf-8'), # 2 x 4 = 8 columns
309 > u'\u3042\u3044\u3046\u3048'.encode('utf-8'), # 2 x 4 = 8 columns
309 > ]
310 > ]
@@ -317,8 +318,9 b' from each other.'
317 > format = item+6
318 > format = item+6
318 > EOF
319 > EOF
319
320
320 $ hg --encoding utf-8 -y loop --total 2 2
321 $ hg --encoding utf-8 -y loop --total 3 3
321 \r (no-eol) (esc)
322 \r (no-eol) (esc)
323 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc)
322 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
324 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
323 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
325 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
324 \r (no-eol) (esc)
326 \r (no-eol) (esc)
@@ -329,8 +331,9 b' from each other.'
329 > format = item-6
331 > format = item-6
330 > EOF
332 > EOF
331
333
332 $ hg --encoding utf-8 -y loop --total 2 2
334 $ hg --encoding utf-8 -y loop --total 3 3
333 \r (no-eol) (esc)
335 \r (no-eol) (esc)
336 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc)
334 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
337 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
335 \xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\r (no-eol) (esc)
338 \xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\r (no-eol) (esc)
336 \r (no-eol) (esc)
339 \r (no-eol) (esc)
General Comments 0
You need to be logged in to leave comments. Login now