~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:54:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506235405-wii4elupfhzl3jvy
Add __str__ to the new helper classes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
""")
39
39
 
 
40
from bzrlib.osutils import watch_sigwinch
 
41
 
40
42
from bzrlib.ui import (
41
43
    UIFactory,
42
44
    NullProgressView,
60
62
        self.stderr = stderr
61
63
        # paints progress, network activity, etc
62
64
        self._progress_view = self.make_progress_view()
 
65
        # hook up the signals to watch for terminal size changes
 
66
        watch_sigwinch()
63
67
 
64
68
    def be_quiet(self, state):
65
69
        if state and not self._quiet:
153
157
        """Construct and return a new ProgressView subclass for this UI.
154
158
        """
155
159
        # with --quiet, never any progress view
156
 
        # <https://bugs.launchpad.net/bzr/+bug/320035>.  Otherwise if the
 
160
        # <https://bugs.edge.launchpad.net/bzr/+bug/320035>.  Otherwise if the
157
161
        # user specifically requests either text or no progress bars, always
158
162
        # do that.  otherwise, guess based on $TERM and tty presence.
159
163
        if self.is_quiet():
229
233
 
230
234
    def show_warning(self, msg):
231
235
        self.clear_term()
232
 
        if isinstance(msg, unicode):
233
 
            te = osutils.get_terminal_encoding()
234
 
            msg = msg.encode(te, 'replace')
235
236
        self.stderr.write("bzr: warning: %s\n" % msg)
236
237
 
237
238
    def _progress_updated(self, task):