Exemplo n.º 1
0
def register_commands(global_context):
    global_context.register_command("help", HelpCommand())
    global_context.register_command("configure", ConfigureCommand())
    global_context.register_command("build", BuildCommand())
    global_context.register_command("install", InstallCommand())
    global_context.register_command("convert", ConvertCommand())
    global_context.register_command("sdist", SdistCommand())
    global_context.register_command("build_egg", BuildEggCommand())
    global_context.register_command("build_wininst", BuildWininstCommand())
    global_context.register_command("sphinx", SphinxCommand())
    global_context.register_command("register_pypi", RegisterPyPI())
    global_context.register_command("upload_pypi", UploadPyPI())

    global_context.register_command("build_pkg_info",
                                    BuildPkgInfoCommand(),
                                    public=False)
    global_context.register_command("parse", ParseCommand(), public=False)
    global_context.register_command("detect_type",
                                    DetectTypeCommand(),
                                    public=False)

    if sys.platform == "darwin":
        import bento.commands.build_mpkg
        global_context.register_command(
            "build_mpkg",
            bento.commands.build_mpkg.BuildMpkgCommand(),
            public=False)
        global_context.set_before("build_mpkg", "build")

    if sys.platform == "win32":
        from bento.commands.build_msi \
            import \
                BuildMsiCommand
        global_context.register_command("build_msi", BuildMsiCommand())
        global_context.set_before("build_msi", "build")
Exemplo n.º 2
0
def create_global_context(package, package_options, backend=None):
    if backend is None:
        backend = YakuBackend()

    global_context = GlobalContext(None)
    global_context.register_package_options(package_options)
    if backend:
        global_context.backend = backend

    build = BuildCommand()
    configure = ConfigureCommand()

    commands = (("configure", configure), ("build", build))

    for cmd_name, cmd in commands:
        global_context.register_command(cmd_name, cmd)
        options_context = OptionsContext.from_command(cmd)
        global_context.register_options_context(cmd_name, options_context)

    global_context.backend.register_command_contexts(global_context)
    global_context.backend.register_options_contexts(global_context)

    return global_context
Exemplo n.º 3
0
def register_commands(global_context):
    global_context.register_command("configure", ConfigureCommand())
    global_context.register_command("build", BuildCommand())
    global_context.register_command("install", InstallCommand())
    global_context.register_command("sdist", SdistCommand())
    global_context.register_command("build_egg", BuildEggCommand())