diff --git a/screen.py b/screen.py index c6b3c02..5c03e9e 100644 --- a/screen.py +++ b/screen.py @@ -121,7 +121,7 @@ class Bitmap: def to_bytemap(self) -> Bytemap: return self._to_bytemap(self.bitmap) - def to_memory_map(self, screen_page:int) -> "MemoryMap": + def to_memory_map(self, screen_page: int) -> "MemoryMap": return self.to_bytemap().to_memory_map(screen_page) @staticmethod @@ -176,7 +176,7 @@ class DHGRBitmap(Bitmap): class FlatMemoryMap: """Linear 8K representation of HGR screen memory.""" - def __init__(self, screen_page: int, data: np.array=None): + def __init__(self, screen_page: int, data: np.array = None): if screen_page not in [1, 2]: raise ValueError("Screen page out of bounds: %d" % screen_page) self.screen_page = screen_page # type: int @@ -205,7 +205,7 @@ class FlatMemoryMap: class MemoryMap: """Page/offset-structured representation of HGR screen memory.""" - def __init__(self, screen_page: int, page_offset: np.array=None): + def __init__(self, screen_page: int, page_offset: np.array = None): if screen_page not in [1, 2]: raise ValueError("Screen page out of bounds: %d" % screen_page) self.screen_page = screen_page # type: int diff --git a/symbol_table_test.py b/symbol_table_test.py index 4d1855c..965b36c 100644 --- a/symbol_table_test.py +++ b/symbol_table_test.py @@ -23,8 +23,8 @@ class TestSymbolTable(unittest.TestCase): def test_parse(self): dbg = io.StringIO(DEBUG_FILE) s = symbol_table.SymbolTable() - self.assertEqual({"\"op_ack\"", "\"op_tick\"", "\"rle1\""}, - s.parse(dbg).keys()) + self.assertEqual( + {"\"op_ack\"", "\"op_tick\"", "\"rle1\""}, s.parse(dbg).keys()) if __name__ == '__main__': diff --git a/video.py b/video.py index 061edb0..6009910 100644 --- a/video.py +++ b/video.py @@ -56,7 +56,7 @@ class Video: yield Image.fromarray(frame_array) @staticmethod - def _rgb(r,g,b): + def _rgb(r, g, b): return (r << 16) + (g << 8) + b # def dither_framesframes(self) -> Iterator[screen.MemoryMap]: diff --git a/video_test.py b/video_test.py index 771a44c..a5f8d87 100644 --- a/video_test.py +++ b/video_test.py @@ -39,7 +39,6 @@ class TestByteToColourString(unittest.TestCase): "1OOO", video.byte_to_colour_string(0xd5, is_odd_offset=True)) - class TestEditWeight(unittest.TestCase): def testTransposition(self): self.assertEqual("WKK0", video.byte_to_colour_string(