~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Robert Collins
  • Date: 2005-09-28 09:35:50 UTC
  • mfrom: (1185.1.47)
  • Revision ID: robertc@robertcollins.net-20050928093550-3ca194dfaffc79f1
merge from integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
    def update(self, msg, current_cnt=None, total_cnt=None):
192
192
        """Update and redraw progress bar."""
193
193
 
 
194
        if current_cnt < 0:
 
195
            current_cnt = 0
 
196
            
 
197
        if current_cnt > total_cnt:
 
198
            total_cnt = current_cnt
 
199
 
194
200
        # save these for the tick() function
195
201
        self.last_msg = msg
196
202
        self.last_cnt = current_cnt
199
205
        if self.throttle():
200
206
            return 
201
207
        
202
 
        if total_cnt:
203
 
            assert current_cnt <= total_cnt
204
 
        if current_cnt:
205
 
            assert current_cnt >= 0
206
 
        
207
208
        if self.show_eta and self.start_time and total_cnt:
208
209
            eta = get_eta(self.start_time, current_cnt, total_cnt)
209
210
            eta_str = " " + str_tdelta(eta)