##// 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 class progbar(object):
142 142 add = encoding.trim(item, wid, leftside=True)
143 143 else:
144 144 add = encoding.trim(item, wid)
145 add += (wid - len(add)) * ' '
145 add += (wid - encoding.colwidth(add)) * ' '
146 146 elif indicator == 'bar':
147 147 add = ''
148 148 needprogress = True
@@ -304,6 +304,7 from each other.
304 304 $ cat >> loop.py <<EOF
305 305 > # use non-ascii characters as loop items of progress
306 306 > loopitems = [
307 > u'\u3042\u3044'.encode('utf-8'), # 2 x 2 = 4 columns
307 308 > u'\u3042\u3044\u3046'.encode('utf-8'), # 2 x 3 = 6 columns
308 309 > u'\u3042\u3044\u3046\u3048'.encode('utf-8'), # 2 x 4 = 8 columns
309 310 > ]
@@ -317,8 +318,9 from each other.
317 318 > format = item+6
318 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 322 \r (no-eol) (esc)
323 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc)
322 324 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
323 325 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
324 326 \r (no-eol) (esc)
@@ -329,8 +331,9 from each other.
329 331 > format = item-6
330 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 335 \r (no-eol) (esc)
336 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc)
334 337 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc)
335 338 \xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\r (no-eol) (esc)
336 339 \r (no-eol) (esc)
General Comments 0
You need to be logged in to leave comments. Login now