~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Martin Pool
  • Date: 2009-11-16 01:18:03 UTC
  • mto: This revision was merged to the branch mainline in revision 4880.
  • Revision ID: mbp@sourcefrog.net-20091116011803-swvfdjkchy856efm
New method ui_factory.make_output_stream

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Text UI, write output to the console.
19
19
"""
20
20
 
 
21
import codecs
21
22
import getpass
22
23
import os
23
24
import sys
146
147
        else:
147
148
            return NullProgressView()
148
149
 
 
150
    def _make_output_stream_explicit(self, encoding, encoding_errors):
 
151
        encoded_stdout = codecs.getwriter(encoding)(self.stdout,
 
152
            errors=encoding_errors)
 
153
        return TextUIOutputStream(self, encoded_stdout)
 
154
 
149
155
    def note(self, msg):
150
156
        """Write an already-formatted message, clearing the progress bar if necessary."""
151
157
        self.clear_term()