示例#1
0
def create_transformer(namespace, options):
    transformer = Transformer(namespace,
                              accept_unprefixed=options.accept_unprefixed)
    transformer.set_include_paths(options.include_paths)
    if options.passthrough_gir:
        transformer.disable_cache()
        transformer.set_passthrough_mode()

    for include in options.includes:
        if os.sep in include:
            _error("Invalid include path %r" % (include, ))
        try:
            include_obj = Include.from_string(include)
        except:
            _error("Malformed include %r\n" % (include, ))
        transformer.register_include(include_obj)
    for include_path in options.includes_uninstalled:
        transformer.register_include_uninstalled(include_path)

    return transformer
示例#2
0
def create_transformer(namespace, options):
    transformer = Transformer(namespace,
                              accept_unprefixed=options.accept_unprefixed)
    transformer.set_include_paths(options.include_paths)
    if options.passthrough_gir:
        transformer.disable_cache()
        transformer.set_passthrough_mode()

    for include in options.includes:
        if os.sep in include:
            _error("Invalid include path %r" % (include, ))
        try:
            include_obj = Include.from_string(include)
        except:
            _error("Malformed include %r\n" % (include, ))
        transformer.register_include(include_obj)
    for include_path in options.includes_uninstalled:
        transformer.register_include_uninstalled(include_path)

    return transformer
示例#3
0
def create_transformer(namespace, options):
    identifier_filter_cmd = shlex.split(options.identifier_filter_cmd)
    symbol_filter_cmd = shlex.split(options.symbol_filter_cmd)
    transformer = Transformer(namespace,
                              accept_unprefixed=options.accept_unprefixed,
                              identifier_filter_cmd=identifier_filter_cmd,
                              symbol_filter_cmd=symbol_filter_cmd)
    transformer.set_include_paths(options.include_paths)
    if options.passthrough_gir or options.reparse_validate_gir:
        transformer.disable_cache()
        transformer.set_passthrough_mode()

    for include in options.includes:
        if os.sep in include:
            _error("Invalid include path '%s'" % (include, ))
        try:
            include_obj = Include.from_string(include)
        except Exception:
            _error("Malformed include '%s'\n" % (include, ))
        transformer.register_include(include_obj)
    for include_path in options.includes_uninstalled:
        transformer.register_include_uninstalled(include_path)

    return transformer