/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: Martin Pool
  • Date: 2010-02-23 02:32:52 UTC
  • mto: This revision was merged to the branch mainline in revision 5054.
  • Revision ID: mbp@sourcefrog.net-20100223023252-zk4ds0sbeuga82et
Clarify Launchpad setup example

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
        self.stderr = stderr
61
61
        # paints progress, network activity, etc
62
62
        self._progress_view = self.make_progress_view()
63
 
 
 
63
        
64
64
    def be_quiet(self, state):
65
65
        if state and not self._quiet:
66
66
            self.clear_term()
153
153
        """Construct and return a new ProgressView subclass for this UI.
154
154
        """
155
155
        # with --quiet, never any progress view
156
 
        # <https://bugs.launchpad.net/bzr/+bug/320035>.  Otherwise if the
 
156
        # <https://bugs.edge.launchpad.net/bzr/+bug/320035>.  Otherwise if the
157
157
        # user specifically requests either text or no progress bars, always
158
158
        # do that.  otherwise, guess based on $TERM and tty presence.
159
159
        if self.is_quiet():
229
229
 
230
230
    def show_warning(self, msg):
231
231
        self.clear_term()
232
 
        if isinstance(msg, unicode):
233
 
            te = osutils.get_terminal_encoding()
234
 
            msg = msg.encode(te, 'replace')
235
232
        self.stderr.write("bzr: warning: %s\n" % msg)
236
233
 
237
234
    def _progress_updated(self, task):
252
249
    def _progress_all_finished(self):
253
250
        self._progress_view.clear()
254
251
 
255
 
    def show_user_warning(self, warning_id, **message_args):
256
 
        """Show a text message to the user.
257
 
 
258
 
        Explicitly not for warnings about bzr apis, deprecations or internals.
259
 
        """
260
 
        # eventually trace.warning should migrate here, to avoid logging and
261
 
        # be easier to test; that has a lot of test fallout so for now just
262
 
        # new code can call this
263
 
        if warning_id not in self.suppressed_warnings:
264
 
            self.stderr.write(self.format_user_warning(warning_id, message_args) +
265
 
                '\n')
266
 
 
267
252
 
268
253
class TextProgressView(object):
269
254
    """Display of progress bar and other information on a tty.