~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

Merge cleanup into first-try resolving conflicts

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
 
 
168
155
    def clear(self):
169
156
        # TODO: deprecate this method; the model object shouldn't be concerned
170
157
        # with whether it's shown or not.  Most callers use this because they
220
207
        self.clear()
221
208
        self._stack.return_pb(self)
222
209
 
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
 
 
229
210
 
230
211
class DummyProgress(object):
231
212
    """Progress-bar standin that does nothing.
248
229
    def clear(self):
249
230
        pass
250
231
 
251
 
    def note(self, fmt_string, *args, **kwargs):
252
 
        """See _BaseProgressBar.note()."""
253
 
 
254
232
    def child_progress(self, **kwargs):
255
233
        return DummyProgress(**kwargs)
256
234