Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (40 sloc) 1.536 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
import optparse
import sys
import os
import string
import types

import c_tools
import doxymlparser
import sip_tools
import swig_tools

from common import *

if __name__ == "__main__":
    option_dict = {
                "output_dir" : ("output", "Directory to output bindings to"),
                "sip" : (True, "Produce SIP bindings"),
                "swig" : (True, "Produce SWIG bindings."),
                "c" : (True, "Produce C wrappers."),
                
    }
    
    parser = optparse.OptionParser(usage="usage: %prog <doxyml files to parse>\n" , version="%prog 1.0")
    
    for opt in option_dict:
        default = option_dict[opt][0]
        
        action = "store"
        if type(default) == types.BooleanType:
            action = "store_true"
        parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1])
    
    options, arguments = parser.parse_args()

    if len(arguments) < 1:
        parser.print_usage()
        sys.exit(1)
    
    doxyparse = doxymlparser.DoxyMLParser()
    for arg in arguments:
        doxyparse.parse(arg)
        
    if options.sip:
        builder = sip_tools.SIPBuilder(doxyparse, options.output_dir)
        builder.make_bindings()
        
    if options.swig:
        builder = swig_tools.SWIGBuilder(doxyparse, options.output_dir)
        builder.make_bindings()
        
    if options.c:
        builder = c_tools.CBuilder(doxyparse, options.output_dir)
        builder.make_bindings()
Something went wrong with that request. Please try again.