~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: 2008-05-08 07:05:00 UTC
  • mfrom: (3376.2.15 no-asserts)
  • Revision ID: pqm@pqm.ubuntu.com-20080508070500-9zyyvsk0eev20t4w
(mbp) remove and disallow assert statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
    def finished(self):
190
190
        """Return this bar to its progress stack."""
191
191
        self.clear()
192
 
        assert self._stack is not None
193
192
        self._stack.return_pb(self)
194
193
 
195
194
    def note(self, fmt_string, *args, **kwargs):
531
530
    
532
531
    total_duration = float(elapsed) * float(total) / float(current)
533
532
 
534
 
    assert total_duration >= elapsed
535
 
 
536
533
    if last_updates and len(last_updates) >= n_recent:
537
534
        avg = sum(last_updates) / float(len(last_updates))
538
535
        time_left = avg * (total - current)
559
556
            self.cur_phase = 0
560
557
        else:
561
558
            self.cur_phase += 1
562
 
        assert self.cur_phase < self.total
563
559
        self.pb.update(self.message, self.cur_phase, self.total)