• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python setup.get_config_schema函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中setup.get_config_schema函数的典型用法代码示例。如果您正苦于以下问题:Python get_config_schema函数的具体用法?Python get_config_schema怎么用?Python get_config_schema使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_config

def get_config(schema=None, warn_about_no_config=True):
    if schema is None:
        from setup import get_config_schema
        schema = get_config_schema()

    if (not schema.have_config() and not schema.have_global_config()
            and warn_about_no_config):
        print "*************************************************************"
        print "*** I have detected that you have not run configure.py."
        print "*************************************************************"
        print "*** Additionally, no global config files were found."
        print "*** I will go ahead with the default configuration."
        print "*** In all likelihood, this will not work out."
        print "*** "
        print "*** See README_SETUP.txt for more information."
        print "*** "
        print "*** If the build does fail, just re-run configure.py with the"
        print "*** correct arguments, and then retry. Good luck!"
        print "*************************************************************"
        print "*** HIT Ctrl-C NOW IF THIS IS NOT WHAT YOU WANT"
        print "*************************************************************"

        delay = 10

        from time import sleep
        import sys
        while delay:
            sys.stdout.write("Continuing in %d seconds...   \r" % delay)
            sys.stdout.flush()
            delay -= 1
            sleep(1)

    return schema.read_config()
开发者ID:stefanv,项目名称:PyOpenCL,代码行数:33,代码来源:aksetup_helper.py


示例2: get_config

def get_config(schema=None, warn_about_no_config=True):
    if schema is None:
        from setup import get_config_schema
        schema = get_config_schema()

    if (not schema.have_config() and not schema.have_global_config()
            and warn_about_no_config):
        print("*************************************************************")
        print("*** I have detected that you have not run configure.py.")
        print("*************************************************************")
        print("*** Additionally, no global config files were found.")
        print("*** I will go ahead with the default configuration.")
        print("*** In all likelihood, this will not work out.")
        print("*** ")
        print("*** See README_SETUP.txt for more information.")
        print("*** ")
        print("*** If the build does fail, just re-run configure.py with the")
        print("*** correct arguments, and then retry. Good luck!")
        print("*************************************************************")
        print("*** HIT Ctrl-C NOW IF THIS IS NOT WHAT YOU WANT")
        print("*************************************************************")

        count_down_delay(delay=10)

    config = expand_options(schema.read_config())
    schema.update_config_from_and_modify_command_line(config, sys.argv)
    return config
开发者ID:inducer,项目名称:meshpy,代码行数:27,代码来源:aksetup_helper.py


示例3: configure_frontend

def configure_frontend():
    from optparse import OptionParser

    from setup import get_config_schema

    schema = get_config_schema()
    if schema.have_config():
        print("************************************************************")
        print("*** I have detected that you have already run configure.")
        print("*** I'm taking the configured values as defaults for this")
        print("*** configure run. If you don't want this, delete the file")
        print("*** %s." % schema.get_conf_file())
        print("************************************************************")

    import sys

    description = "generate a configuration file for this software package"
    parser = OptionParser(description=description)
    parser.add_option(
        "--python-exe",
        dest="python_exe",
        default=sys.executable,
        help="Which Python interpreter to use",
        metavar="PATH",
    )

    parser.add_option("--prefix", default=None, help="Ignored")
    parser.add_option("--enable-shared", help="Ignored", action="store_false")
    parser.add_option("--disable-static", help="Ignored", action="store_false")
    parser.add_option("--update-user", help="Update user config file (%s)" % schema.user_conf_file, action="store_true")
    parser.add_option(
        "--update-global", help="Update global config file (%s)" % schema.global_conf_file, action="store_true"
    )

    schema.add_to_configparser(parser, schema.read_config())

    options, args = parser.parse_args()

    config = schema.get_from_configparser(options)
    schema.write_config(config)

    if options.update_user:
        schema.update_user_config(config)

    if options.update_global:
        schema.update_global_config(config)

    import os

    if os.access("Makefile.in", os.F_OK):
        substs = schema.make_substitutions(config)
        substs["PYTHON_EXE"] = options.python_exe

        substitute(substs, "Makefile")
开发者ID:hvcl,项目名称:Vivaldi,代码行数:54,代码来源:aksetup_helper.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python setup.print_failure_message函数代码示例发布时间:2022-05-27
下一篇:
Python setup.atest函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap