summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-05-01 12:55:57 +0300
committerLars Wirzenius <liw@liw.fi>2015-05-01 12:55:57 +0300
commit9c7bf04a8e00fa9813803aa51a7806c3b732a275 (patch)
treef81b13e33e8df6cf6c2b7c0041fc98ded747c3b3
parentce31ea6dc01898bf03a1ba7e86b263c12802fbde (diff)
downloadttystatus-9c7bf04a8e00fa9813803aa51a7806c3b732a275.tar.gz
Whitespace fixes for PEP8
-rw-r--r--ttystatus/bytesize.py8
-rw-r--r--ttystatus/bytesize_tests.py6
-rw-r--r--ttystatus/bytespeed.py8
-rw-r--r--ttystatus/bytespeed_tests.py2
-rw-r--r--ttystatus/elapsed_tests.py2
-rw-r--r--ttystatus/messager_tests.py4
6 files changed, 15 insertions, 15 deletions
diff --git a/ttystatus/bytesize.py b/ttystatus/bytesize.py
index bd29225..41c35fc 100644
--- a/ttystatus/bytesize.py
+++ b/ttystatus/bytesize.py
@@ -32,10 +32,10 @@ class ByteSize(ttystatus.Widget):
def render(self, width):
units = (
- (1024**4, 2, 'TiB'),
- (1024**3, 2, 'GiB'),
- (1024**2, 2, 'MiB'),
- (1024**1, 1, 'KiB'),
+ (1024 ** 4, 2, 'TiB'),
+ (1024 ** 3, 2, 'GiB'),
+ (1024 ** 2, 2, 'MiB'),
+ (1024 ** 1, 1, 'KiB'),
)
for factor, decimals, unit in units:
diff --git a/ttystatus/bytesize_tests.py b/ttystatus/bytesize_tests.py
index 7f50248..be76e6a 100644
--- a/ttystatus/bytesize_tests.py
+++ b/ttystatus/bytesize_tests.py
@@ -47,13 +47,13 @@ class ByteSizeTests(unittest.TestCase):
self.assertEqual(self.w.render(0), '1.0 KiB')
def test_formats_1_MiB_bytes_correctly(self):
- self.w.update({'foo': 1024**2})
+ self.w.update({'foo': 1024 ** 2})
self.assertEqual(self.w.render(0), '1.00 MiB')
def test_formats_1_GiB_bytes_correctly(self):
- self.w.update({'foo': 1024**3})
+ self.w.update({'foo': 1024 ** 3})
self.assertEqual(self.w.render(0), '1.00 GiB')
def test_formats_1_TiB_bytes_correctly(self):
- self.w.update({'foo': 1024**4})
+ self.w.update({'foo': 1024 ** 4})
self.assertEqual(self.w.render(0), '1.00 TiB')
diff --git a/ttystatus/bytespeed.py b/ttystatus/bytespeed.py
index 098dd4a..06c5bb0 100644
--- a/ttystatus/bytespeed.py
+++ b/ttystatus/bytespeed.py
@@ -36,10 +36,10 @@ class ByteSpeed(ttystatus.Widget):
def render(self, width):
units = (
- (1024**4, 2, 'TiB/s'),
- (1024**3, 2, 'GiB/s'),
- (1024**2, 2, 'MiB/s'),
- (1024**1, 1, 'KiB/s'),
+ (1024 ** 4, 2, 'TiB/s'),
+ (1024 ** 3, 2, 'GiB/s'),
+ (1024 ** 2, 2, 'MiB/s'),
+ (1024 ** 1, 1, 'KiB/s'),
)
if len(self._data_points) < 2:
diff --git a/ttystatus/bytespeed_tests.py b/ttystatus/bytespeed_tests.py
index 2070e47..407ff30 100644
--- a/ttystatus/bytespeed_tests.py
+++ b/ttystatus/bytespeed_tests.py
@@ -55,7 +55,7 @@ class ByteSpeedTests(unittest.TestCase):
self.w.now = lambda: 1
self.w.update({'foo': 0})
self.w.now = lambda: 2
- self.w.update({'foo': 10 * 1024**4})
+ self.w.update({'foo': 10 * 1024 ** 4})
self.assertEqual(self.w.render(0), '10.00 TiB/s')
def test_keeps_only_two_data_points_with_infinite_duration(self):
diff --git a/ttystatus/elapsed_tests.py b/ttystatus/elapsed_tests.py
index d9ec5be..19812e2 100644
--- a/ttystatus/elapsed_tests.py
+++ b/ttystatus/elapsed_tests.py
@@ -38,6 +38,6 @@ class ElapsedtimeTests(unittest.TestCase):
def test_shows_one_one_one_after_second_update(self):
self.w.get_time = lambda: 0
self.w.update({})
- self.w.get_time = lambda: 60*60 + 60 + 1
+ self.w.get_time = lambda: 60 * 60 + 60 + 1
self.w.update({})
self.assertEqual(self.w.render(0), '01h01m01s')
diff --git a/ttystatus/messager_tests.py b/ttystatus/messager_tests.py
index ea94969..221be13 100644
--- a/ttystatus/messager_tests.py
+++ b/ttystatus/messager_tests.py
@@ -61,8 +61,8 @@ class MessagerTests(unittest.TestCase):
self.assertFalse(self.messager.time_to_write())
def test_knows_it_is_time_to_write_after_a_period(self):
- self.messager._last_time = (self.messager._now() -
- self.messager._period*2)
+ self.messager._last_time = (
+ self.messager._now() - self.messager._period * 2)
self.assert_(self.messager.time_to_write())
def test_cached_write_writes_first_thing(self):