~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-21 12:51:25 UTC
  • mfrom: (6468.3.1 bzr)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120221125125-7cpkwjmvf3aj2d9x
MergeĀ lp:~jelmer/bzr/use-tree-iter-children

Show diffs side-by-side

added added

removed removed

Lines of Context:
404
404
    this only prints the stack from the nominated current task up to the root.
405
405
    """
406
406
 
407
 
    def __init__(self, term_file, encoding=None, errors="replace"):
 
407
    def __init__(self, term_file):
408
408
        self._term_file = term_file
409
 
        if encoding is None:
410
 
            self._encoding = getattr(term_file, "encoding", None) or "ascii"
411
 
        else:
412
 
            self._encoding = encoding
413
 
        self._encoding_errors = errors
414
409
        # true when there's output on the screen we may need to clear
415
410
        self._have_output = False
416
411
        self._last_transport_msg = ''
437
432
        else:
438
433
            return w - 1
439
434
 
440
 
    def _show_line(self, u):
441
 
        s = u.encode(self._encoding, self._encoding_errors)
 
435
    def _show_line(self, s):
 
436
        # sys.stderr.write("progress %r\n" % s)
442
437
        width = self._avail_width()
443
438
        if width is not None:
444
 
            # GZ 2012-03-28: Counting bytes is wrong for calculating width of
445
 
            #                text but better than counting codepoints.
446
439
            s = '%-*.*s' % (width, width, s)
447
440
        self._term_file.write('\r' + s + '\r')
448
441