Fix progress bar minor step bug

This commit is contained in:
mozbugbox 2014-02-23 14:46:41 +08:00
parent 79867ab489
commit db6c428db5

View File

@ -514,8 +514,9 @@ class SimpleProgressBar(BaseProgressBar):
percent = round(self.received * 100 / self.total_size, 1) percent = round(self.received * 100 / self.total_size, 1)
if percent > 100: if percent > 100:
percent = 100 percent = 100
dots = bar_size * int(percent) // 100 dots_float = bar_size * percent / 100
plus = int(percent) - dots // bar_size * 100 dots = int(dots_float)
plus = dots_float - dots
if plus > 0.8: if plus > 0.8:
plus = '=' plus = '='
elif plus > 0.4: elif plus > 0.4: