~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/utextwrap.py

  • Committer: INADA Naoki
  • Date: 2011-05-08 03:55:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5874.
  • Revision ID: songofacandy@gmail.com-20110508035515-ypj2sbnhivfk3py1
Drop supporting byte string in private functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
    NOTE: Supporting byte string should be removed with Python 3.
47
47
    """
48
 
    if isinstance(s, str):
49
 
        return len(s)
50
48
    assert isinstance(s, unicode)
51
49
    return sum(_unicode_char_width(c) for c in s)
52
50
 
55
53
 
56
54
    Head is large as long as _width(head) <= width.
57
55
    """
58
 
    if isinstance(s, str):
59
 
        return s[:width], s[width:]
60
56
    assert isinstance(s, unicode)
61
57
    w = 0
62
58
    charwidth = _unicode_char_width