diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-01-09 11:52:35 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-01-09 11:53:37 +0200 |
commit | ad80c940fb6c344a7029151859b50f01bdaf03a3 (patch) | |
tree | 76f53ec7efcbb685f773e117fa432fdb276d3fc5 | |
parent | 85314ecb5d589f92715c2c224beac7ad0460754e (diff) | |
download | ttystatus-ad80c940fb6c344a7029151859b50f01bdaf03a3.tar.gz |
Fix variable type issues found by pylint
-rw-r--r-- | ttystatus/percent.py | 6 | ||||
-rw-r--r-- | 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)) |