From 3ed275668014bbe6c50489652aa04e3764fbd9f2 Mon Sep 17 00:00:00 2001 From: comex Date: Thu, 29 Jan 2009 21:31:58 -0500 Subject: pointless features --- write-brlyt.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'write-brlyt.py') diff --git a/write-brlyt.py b/write-brlyt.py index a424e11..79b47be 100644 --- a/write-brlyt.py +++ b/write-brlyt.py @@ -5,6 +5,18 @@ f = open(sys.argv[1], 'r') chunks = eval(f.read()) f.close() +# ugly hack +def flatten(chunks): + a = [] + for c in chunks: + if type(c) == list: + a += flatten(c) + else: + a.append(c) + return a +chunks = flatten(chunks) + + rlyt = 'RLYT\xfe\xff\x00\x08\x00\x00\x00\x00' # size later rlyt += struct.pack('>hh', 0x10, len(chunks)) -- cgit v1.3.1