/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Parth Malwankar
  • Date: 2010-02-15 10:46:49 UTC
  • mto: This revision was merged to the branch mainline in revision 5048.
  • Revision ID: parth.malwankar@gmail.com-20100215104649-bo4z8rhqvfibnxhj
updated existing upgrade tests to work.

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
 
 
42
40
from bzrlib.ui import (
43
41
    UIFactory,
44
42
    NullProgressView,
62
60
        self.stderr = stderr
63
61
        # paints progress, network activity, etc
64
62
        self._progress_view = self.make_progress_view()
65
 
        # hook up the signals to watch for terminal size changes
66
 
        watch_sigwinch()
67
 
 
 
63
        
68
64
    def be_quiet(self, state):
69
65
        if state and not self._quiet:
70
66
            self.clear_term()
233
229
 
234
230
    def show_warning(self, msg):
235
231
        self.clear_term()
236
 
        if isinstance(msg, unicode):
237
 
            te = osutils.get_terminal_encoding()
238
 
            msg = msg.encode(te, 'replace')
239
232
        self.stderr.write("bzr: warning: %s\n" % msg)
240
233
 
241
234
    def _progress_updated(self, task):
256
249
    def _progress_all_finished(self):
257
250
        self._progress_view.clear()
258
251
 
259
 
    def show_user_warning(self, warning_id, **message_args):
260
 
        """Show a text message to the user.
261
 
 
262
 
        Explicitly not for warnings about bzr apis, deprecations or internals.
263
 
        """
264
 
        # eventually trace.warning should migrate here, to avoid logging and
265
 
        # be easier to test; that has a lot of test fallout so for now just
266
 
        # new code can call this
267
 
        if warning_id not in self.suppressed_warnings:
268
 
            self.stderr.write(self.format_user_warning(warning_id, message_args) +
269
 
                '\n')
270
 
 
271
252
 
272
253
class TextProgressView(object):
273
254
    """Display of progress bar and other information on a tty.