~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-07-16 14:02:58 UTC
  • mfrom: (5346.2.3 doc)
  • Revision ID: pqm@pqm.ubuntu.com-20100716140258-js1p8i24w8nodz6t
(mbp) developer docs about transports and symlinks (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
                own_fraction = 0.0
153
153
            return self._parent_task._overall_completion_fraction(own_fraction)
154
154
 
 
155
    @deprecated_method(deprecated_in((2, 1, 0)))
 
156
    def note(self, fmt_string, *args):
 
157
        """Record a note without disrupting the progress bar.
 
158
        
 
159
        Deprecated: use ui_factory.note() instead or bzrlib.trace.  Note that
 
160
        ui_factory.note takes just one string as the argument, not a format
 
161
        string and arguments.
 
162
        """
 
163
        if args:
 
164
            self.ui_factory.note(fmt_string % args)
 
165
        else:
 
166
            self.ui_factory.note(fmt_string)
 
167
 
155
168
    def clear(self):
156
169
        # TODO: deprecate this method; the model object shouldn't be concerned
157
170
        # with whether it's shown or not.  Most callers use this because they
207
220
        self.clear()
208
221
        self._stack.return_pb(self)
209
222
 
 
223
    def note(self, fmt_string, *args, **kwargs):
 
224
        """Record a note without disrupting the progress bar."""
 
225
        self.clear()
 
226
        self.to_messages_file.write(fmt_string % args)
 
227
        self.to_messages_file.write('\n')
 
228
 
210
229
 
211
230
class DummyProgress(object):
212
231
    """Progress-bar standin that does nothing.
229
248
    def clear(self):
230
249
        pass
231
250
 
 
251
    def note(self, fmt_string, *args, **kwargs):
 
252
        """See _BaseProgressBar.note()."""
 
253
 
232
254
    def child_progress(self, **kwargs):
233
255
        return DummyProgress(**kwargs)
234
256