~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-21 13:36:51 UTC
  • mfrom: (5243.2.1 readdir_cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100521133651-p62dndo2giy5ls21
(lifeless) Some cleanups to the readdir pyrex code for a little efficiency
 and to avoid compile warnings. (John A Meinel)

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):