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


Python OPTIONS.write_configure_file方法代码示例

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


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

示例1: _configure_build_options

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import write_configure_file [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
开发者ID:NaiveTorch,项目名称:ARC,代码行数:37,代码来源:configure.py


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