2006-10-01 Don Allingham <don@gramps-project.org>

* src/Utils.py: catch divide by zero case
	* src/ViewManager.py: change change to same page (#410)



svn: r7339
This commit is contained in:
Don Allingham
2006-10-02 02:10:12 +00:00
parent 48fbb0f0db
commit 433710c483
3 changed files with 22 additions and 5 deletions

View File

@ -972,10 +972,14 @@ class ProgressMeter:
"""Click the progress bar over to the next value. Be paranoid
and insure that it doesn't go over 100%."""
self.pbar_index = self.pbar_index + 1.0
if (self.pbar_index > self.pbar_max):
if self.pbar_index > self.pbar_max:
self.pbar_index = self.pbar_max
val = int(100*self.pbar_index/self.pbar_max)
try:
val = int(100*self.pbar_index/self.pbar_max)
except ZeroDivisionError:
val = 0
if val != self.old_val:
self.pbar.set_text("%d%%" % val)