mkenums: Use the same reporting functions from genmarshal
[glib.git] / gobject / gmarshal-list-to-strings.py
blobee609532d7a8a8dff093cd306ffe14c89f2ce87f
1 #!/usr/bin/env python3
2 # Does the same thing as `marshal-genstrings.pl` and the 'gmarshal.strings'
3 # target in Makefile.am
5 import re
6 import sys
8 prefix = '"g_cclosure_marshal_'
9 suffix = '",\n'
11 if len(sys.argv) != 3:
12 print('Usage: {0} <input> <output>'.format(sys.argv[0]))
14 fin = open(sys.argv[1], 'r')
15 fout = open(sys.argv[2], 'w')
17 for line in fin:
18 if not line[0].isalpha():
19 continue
20 symbol = line[:-1].replace(':', '__').replace(',', '_')
21 fout.write(prefix + symbol + suffix)