2 # -*- coding: utf-8 -*-
8 debug
= os
.getenv('GIO_GENTYPEFUNCS_DEBUG') is not None
10 out_file
= sys
.argv
[1]
11 in_files
= sys
.argv
[2:]
16 if debug
: print ('Output file: ', out_file
)
18 if debug
: print (len(in_files
), 'input files')
20 for filename
in in_files
:
21 if debug
: print ('Input file: ', filename
)
22 with
open(filename
, 'rb') as f
:
24 line
= line
.rstrip(b
'\n').rstrip(b
'\r')
26 match
= re
.search(b
'\bg_[a-zA-Z0-9_]*_get_type\b', line
)
31 if debug
: print ('Found ', func
)
33 file_output
= 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS\n'
38 if f
not in ['g_io_extension_get_type', 'g_settings_backend_get_type']:
39 file_output
+= '*tp++ = {0} ();\n'.format(f
)
41 if debug
: print (len(funcs
), 'functions')
43 ofile
= open(out_file
, "w")
44 ofile
.write(file_output
)