Ejemplo n.º 1
0
 def character(self, top, bottom):
     "Turn two sixteen-bit words into a list representing a bitmap."
     # organize the bits into columns
     columns = [
         [x for x in bit_iter(top >> 8, 8)][::-1],
         [x for x in bit_iter(top & 0xff, 8)][::-1],
         [x for x in bit_iter(bottom >> 8, 8)][::-1],
         [x for x in bit_iter(bottom & 0xff, 8)][::-1],
     ]
     # zip them, to rearrange them into rows.
     return zip(*columns)
Ejemplo n.º 2
0
 def assertBits(self, given, digits, expected):
     self.assertEquals(list(bit_iter(given, digits)), expected)