mirror of
https://github.com/michaelcmartin/Ophis.git
synced 2024-12-22 03:29:55 +00:00
14a37ca879
Full PEP8 compliance. Also, booleans have been inserted where they make sense (introduced in 2.3!) and I haven't knowingly added anything that will break 2.3 compatibility. At this point the code really doesn't look like it was written ten years ago. Hooray!
23 lines
529 B
Python
23 lines
529 B
Python
#!/usr/bin/python
|
|
import struct
|
|
|
|
x = ''.join([chr(x) for x in range(256)])
|
|
bits = struct.unpack("32s32s32s32s32s32s32s32s", x)
|
|
norm = [4, 5, 6, 7, 0, 1, 2, 3]
|
|
ivrs = [4, 1, 0, 7, 6, 5, 2, 3]
|
|
blnk = [4, 3, 2, 7, 0, 1, 6, 5]
|
|
normmap = ''.join([bits[x] for x in norm])
|
|
ivrsmap = ''.join([bits[x] for x in ivrs])
|
|
blnkmap = ''.join([bits[x] for x in blnk])
|
|
|
|
|
|
def dumpfile(n, m):
|
|
f = file(n, 'wb')
|
|
f.write(m)
|
|
f.close()
|
|
|
|
|
|
dumpfile('a2normal.map', normmap)
|
|
dumpfile('a2inverse.map', ivrsmap)
|
|
dumpfile('a2blink.map', blnkmap)
|