Cast to WORD (not sure it's necessary) and put braces around the arguments.
[fx2lib.git] / utils / gpif2dat
blob7762f9415d91465449ebd3c4a043af3611061bd3
1 #!/bin/env python
3 import sys,re
5 if __name__=='__main__':
6     if len(sys.argv)<3:
7         print "Usage: %s <gpif export file> <save file>" % sys.argv[0]
8         sys.exit(-1)
10     f=open(sys.argv[1],'r').read()
11     o=open(sys.argv[2],'w')
13     # write every thing between the wave data and the TODO
14     datre = re.compile ( 'const char xdata .*?\};', re.S )
15     data = datre.findall(f)
16     for dat in data:
17         o.write(dat.replace('\r\n','\n'))
18         o.write('\n')
19     o.close()