~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

(lifeless) Generalise probing for executables used in selftest. (Martin von
 Gagern)

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        """Construct and return a new ProgressView subclass for this UI.
158
158
        """
159
159
        # with --quiet, never any progress view
160
 
        # <https://bugs.edge.launchpad.net/bzr/+bug/320035>.  Otherwise if the
 
160
        # <https://bugs.launchpad.net/bzr/+bug/320035>.  Otherwise if the
161
161
        # user specifically requests either text or no progress bars, always
162
162
        # do that.  otherwise, guess based on $TERM and tty presence.
163
163
        if self.is_quiet():
233
233
 
234
234
    def show_warning(self, msg):
235
235
        self.clear_term()
 
236
        if isinstance(msg, unicode):
 
237
            te = osutils.get_terminal_encoding()
 
238
            msg = msg.encode(te, 'replace')
236
239
        self.stderr.write("bzr: warning: %s\n" % msg)
237
240
 
238
241
    def _progress_updated(self, task):