本文整理汇总了Python中build_options.OPTIONS.parse方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.parse方法的具体用法?Python OPTIONS.parse怎么用?Python OPTIONS.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.parse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _stub_parse_configure_file
# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse [as 别名]
def _stub_parse_configure_file():
"""A helper function for trapping calls to read the build options file.
Populate them with the default build configuration instead, so this test
behaves the same regardless of the actual configuration.
"""
OPTIONS.parse([])
示例2: _configure_build_options
# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse [as 别名]
def _configure_build_options():
if OPTIONS.parse(sys.argv[1:]):
print 'Args error'
return False
# Write out the configure file early so all other scripts can use
# the options passed into configure. (e.g., sync_chrome).
OPTIONS.write_configure_file()
# Target directory is replaced. If an old directory, out/target/<target>,
# exists, move it to the new place, out/target/<target>_<opt>.
old_path = os.path.join('out/target', OPTIONS.target())
new_path = build_common.get_build_dir()
if os.path.lexists(old_path):
if os.path.isdir(old_path) and not os.path.islink(old_path):
if os.path.exists(new_path):
shutil.rmtree(old_path)
else:
shutil.move(old_path, new_path)
else:
os.remove(old_path)
# Create an empty directory as a placeholder if necessary.
build_common.makedirs_safely(new_path)
# Create a symlink from new place to old place to keep as compatible as
# possible.
os.symlink(os.path.basename(new_path), old_path)
# Write out the configure file to a target specific location, which can be
# queried later to find out what the config for a target was.
OPTIONS.write_configure_file(build_common.get_target_configure_options_file())
OPTIONS.set_up_goma()
return True