1 # Simple Python script to generate the full .schema.xml files
7 from replace
import replace_multi
10 srcroot
= os
.path
.join(os
.path
.abspath(os
.path
.dirname(__file__
)), '..')
11 parser
= argparse
.ArgumentParser(description
='Generate Utility Scripts')
12 parser
.add_argument('-t', '--type', help='Script Type (glib-mkenums or gdbus-codegen)', required
=True)
13 parser
.add_argument('--version', help='Package Version', required
=True)
14 args
= parser
.parse_args()
16 replace_items
= {'@PYTHON@': 'python',
17 '@PERL_PATH@': 'perl',
18 '@GLIB_VERSION@': args
.version
,
19 '@VERSION@': args
.version
}
21 if args
.type == 'glib-mkenums':
22 replace_multi(srcroot
+ '/gobject/glib-mkenums.in',
23 srcroot
+ '/gobject/glib-mkenums',
25 elif args
.type == 'glib-genmarshal':
26 replace_multi(srcroot
+ '/gobject/glib-genmarshal.in',
27 srcroot
+ '/gobject/glib-genmarshal',
29 elif args
.type == 'gdbus-codegen':
30 replace_multi(srcroot
+ '/gio/gdbus-2.0/codegen/gdbus-codegen.in',
31 srcroot
+ '/gio/gdbus-2.0/codegen/gdbus-codegen',
35 raise ValueError('Type must be glib-mkenums or gdbus-codegen')
37 if __name__
== '__main__':
38 sys
.exit(main(sys
.argv
))