1 #1 is generate_fishcode.py
4 #4 are the parameters for cut
9 fp
= open(sys
.argv
[1], "rb")
17 fp
= open(sys
.argv
[1], "r")
21 fp
= open(sys
.argv
[2], "wb")
22 fp
.write('#define CHECKSUM "%s"\n' % sm
)
23 fp
.write('static const char *fishCode(\n')
25 r
= re
.sub(r
'\\', r
'\\\\', r
)
26 r
= re
.sub(r
'"', r
'\\"', r
)
27 p
= re
.compile('^[ ]*', re
.M
)
29 p
= re
.compile(r
'^"# .*\n*', re
.M
)
31 p
= re
.compile('[ ]*$', re
.M
)
33 p
= re
.compile(r
'^"\\n"\n?', re
.M
)
35 r
= re
.sub(r
'{CHECKSUM}', sm
, r
, 1)