当前位置: 首页>>代码示例>>Python>>正文


Python Context.apiMemberSets方法代码示例

本文整理汇总了Python中context.Context.apiMemberSets方法的典型用法代码示例。如果您正苦于以下问题:Python Context.apiMemberSets方法的具体用法?Python Context.apiMemberSets怎么用?Python Context.apiMemberSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在context.Context的用法示例。


在下文中一共展示了Context.apiMemberSets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate

# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import apiMemberSets [as 别名]

#.........这里部分代码省略.........
    print("")
    print("RESOLVING")

    print("resolving features")
    resolveFeatures(features, enumsByName, commandsByName)

    print("resolving extensions")
    resolveExtensions(extensions, enumsByName, commandsByName, features, api)

    print("resolving groups")
    resolveGroups(groups, enumsByName)

    print("resolving enums")
    resolveEnums(enums, enumsByName, groupsByName)

    # verifying

    print("")
    print("VERIFYING")

    bitfGroups = [ g for g in groups
        if len(g.enums) > 0 and any(enum.type == "GLbitfield" for enum in g.enums) ]

    print("verifying groups")
    verifyGroups(groups, enums)

    print("verifying commands")
    verifyCommands(commands, bitfGroups)

    # generating

    print("")
    print("GENERATING")
    generateBegin = time.time()

    includedir = pjoin(targetdir, "include/glbinding/")
    includedir_api = pjoin(includedir, "{api}{memberSet}/")
    sourcedir  = pjoin(targetdir, "source/")
    sourcedir_api  = pjoin(sourcedir, "{api}/")
    testdir    = pjoin(targetdir, "../tests/glbinding-test/")

    context = Context(api, revision, features, extensions, enums, bitfGroups, types, commands)
    generalContext = context.general()

    # Generate files with common context
    Generator.generate(generalContext, pjoin(sourcedir, "glrevision.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "extension.h"))
    # Generator.generate(generalContext, pjoin(includedir_api, "boolean.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "values.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "types.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "bitfield.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "enum.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "functions.h"))
    Generator.generate(generalContext, pjoin(includedir_api, "gl.h"))

    Generator.generate(generalContext, pjoin(sourcedir_api, "types.cpp"))
    Generator.generate(generalContext, pjoin(testdir, "AllVersions_test.cpp"))
    Generator.generate(generalContext, pjoin(includedir, "Binding.h"))
    Generator.generate(generalContext, pjoin(sourcedir, "Binding_list.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir, "Version_ValidVersions.cpp"))

    Generator.generate(generalContext, pjoin(includedir, "Meta.h"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_Maps.h"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_getStringByBitfield.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_StringsByBitfield.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_BitfieldsByString.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_StringsByBoolean.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_BooleansByString.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_StringsByEnum.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_EnumsByString.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_StringsByExtension.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_ExtensionsByString.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_ReqVersionsByExtension.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_FunctionStringsByExtension.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_FunctionStringsByVersion.cpp"))
    Generator.generate(generalContext, pjoin(sourcedir,  "Meta_ExtensionsByFunctionString.cpp"))

    # Generate function-related files with specific contexts for each initial letter of the function name
    for functionGroup in generalContext["functionsByInitial"]["groups"]:
        specificContext = generalContext.copy()
        specificContext["currentFunctionGroup"] = functionGroup
        specificContext["currentFunctionInitial"] = functionGroup["name"].lower()

        Generator.generate(specificContext, pjoin(sourcedir_api, "functions_{currentFunctionInitial}.cpp"), "functions.cpp")
        Generator.generate(specificContext, pjoin(sourcedir, "Binding_objects_{currentFunctionInitial}.cpp"), "Binding_objects.cpp")

    # Generate files with ApiMemberSet-specific contexts
    for feature, core, ext in context.apiMemberSets():
        specificContext = context.apiMemberSetSpecific(feature, core, ext)

        Generator.generate(specificContext, pjoin(includedir_api, "boolean.h"), "booleanF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "values.h"), "valuesF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "types.h"), "typesF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "bitfield.h"), "bitfieldF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "enum.h"), "enumF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "functions.h"), "functionsF.h")
        Generator.generate(specificContext, pjoin(includedir_api, "gl.h"), "glF.h")

    generateEnd = time.time()
    print("generation took {:.3f} seconds".format(generateEnd - generateBegin))
开发者ID:achurch,项目名称:glbinding,代码行数:104,代码来源:generate.py


注:本文中的context.Context.apiMemberSets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。