本文整理汇总了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;未经允许,请勿转载。 |
请发表评论