comparison mercurial/util.py @ 25210:b58dde1bb32f

MBTextWrapper: drop dedicated __init__ method It was only there as a compatibility layer with a version of Python which we do support anymore.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 May 2015 16:56:04 -0500
parents 277a535c0b3a
children 22f4ce49044d
comparison
equal deleted inserted replaced
25209:277a535c0b3a 25210:b58dde1bb32f
1552 In addition, characters classified into 'ambiguous' width are 1552 In addition, characters classified into 'ambiguous' width are
1553 treated as wide in East Asian area, but as narrow in other. 1553 treated as wide in East Asian area, but as narrow in other.
1554 1554
1555 This requires use decision to determine width of such characters. 1555 This requires use decision to determine width of such characters.
1556 """ 1556 """
1557 def __init__(self, **kwargs):
1558 textwrap.TextWrapper.__init__(self, **kwargs)
1559
1560 # for compatibility between 2.4 and 2.6
1561 if getattr(self, 'drop_whitespace', None) is None:
1562 self.drop_whitespace = kwargs.get('drop_whitespace', True)
1563
1564 def _cutdown(self, ucstr, space_left): 1557 def _cutdown(self, ucstr, space_left):
1565 l = 0 1558 l = 0
1566 colwidth = encoding.ucolwidth 1559 colwidth = encoding.ucolwidth
1567 for i in xrange(len(ucstr)): 1560 for i in xrange(len(ucstr)):
1568 l += colwidth(ucstr[i]) 1561 l += colwidth(ucstr[i])