progressbar: Make bars show correctly with maxval == 0
PATCH 1/1 progressbar: Make bars show correctly with maxval == 0
While it can be argued how useful a progressbar created with 0 as maximum value is, it should still show two states, started (empty) and finished (full). Setting the maxval to _DEFAULT_MAXVAL instead will accomplish this.
Signed-off-by Peter Kjellerstedt <[email protected]>
---
This solves an additional problem related to the progress bars that I noticed. This typically happens when the dependency cache is empty.
bitbake/lib/progressbar/progressbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/progressbar/progressbar.py +1 -1
@@ -106,7 +106,7 @@ class ProgressBar(object): if widgets is None: widgets = list(self._DEFAULT_WIDGETS) - self.maxval = maxval + self.maxval = maxval if maxval != 0 else self._DEFAULT_MAXVAL self.widgets = widgets self.fd = fd self.left_justify = left_justify