From ad80c940fb6c344a7029151859b50f01bdaf03a3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 9 Jan 2016 11:52:35 +0200 Subject: Fix variable type issues found by pylint --- ttystatus/percent.py | 6 +++--- ttystatus/progressbar.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ttystatus/percent.py b/ttystatus/percent.py index ebe4e61..762cb82 100644 --- a/ttystatus/percent.py +++ b/ttystatus/percent.py @@ -35,10 +35,10 @@ class PercentDone(ttystatus.Widget): done = float(self.done) total = float(self.total) except ValueError: - done = 0 - total = 1 + done = 0.0 + total = 1.0 if total < 0.001: - total = 1 + total = 1.0 return '%.*f %%' % (self.decimals, 100.0 * done / total) def update(self, master): diff --git a/ttystatus/progressbar.py b/ttystatus/progressbar.py index 5c5663f..577f0fc 100644 --- a/ttystatus/progressbar.py +++ b/ttystatus/progressbar.py @@ -34,10 +34,10 @@ class ProgressBar(ttystatus.Widget): done = float(self.done) total = float(self.total) except ValueError: - done = 0 - total = 1 + done = 0.0 + total = 1.0 if total == 0: - fraction = 0 + fraction = 0.0 else: fraction = done / total n_stars = int(round(fraction * width)) -- cgit v1.2.1