]> git.saurik.com Git - wxWidgets.git/blame - docs/doxygen/scripts/make_bindings.py
Remove chars one-by-one with wxELLIPSIZE_MIDDLE.
[wxWidgets.git] / docs / doxygen / scripts / make_bindings.py
CommitLineData
4e735ed6
KO
1import optparse
2import sys
3import os
4import string
1013a789
KO
5import types
6
7import c_tools
8import doxymlparser
0cbc1d02
KO
9import sip_tools
10import swig_tools
4e735ed6 11
0cbc1d02
KO
12from common import *
13
1013a789
KO
14if __name__ == "__main__":
15 option_dict = {
16 "output_dir" : ("output", "Directory to output bindings to"),
17 "sip" : (True, "Produce SIP bindings"),
18 "swig" : (True, "Produce SWIG bindings."),
19 "c" : (True, "Produce C wrappers."),
20
21 }
4e735ed6 22
1013a789
KO
23 parser = optparse.OptionParser(usage="usage: %prog <doxyml files to parse>\n" , version="%prog 1.0")
24
25 for opt in option_dict:
26 default = option_dict[opt][0]
27
28 action = "store"
29 if type(default) == types.BooleanType:
30 action = "store_true"
31 parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1])
32
33 options, arguments = parser.parse_args()
4e735ed6 34
4e735ed6
KO
35 if len(arguments) < 1:
36 parser.print_usage()
37 sys.exit(1)
38
39 doxyparse = doxymlparser.DoxyMLParser()
40 for arg in arguments:
41 doxyparse.parse(arg)
42
43 if options.sip:
0cbc1d02 44 builder = sip_tools.SIPBuilder(doxyparse, options.output_dir)
4e735ed6
KO
45 builder.make_bindings()
46
47 if options.swig:
0cbc1d02 48 builder = swig_tools.SWIGBuilder(doxyparse, options.output_dir)
4e735ed6 49 builder.make_bindings()
1013a789
KO
50
51 if options.c:
52 builder = c_tools.CBuilder(doxyparse, options.output_dir)
53 builder.make_bindings()