本文整理汇总了Python中mozbuild.frontend.reader.BuildReader.walk_topsrcdir方法的典型用法代码示例。如果您正苦于以下问题:Python BuildReader.walk_topsrcdir方法的具体用法?Python BuildReader.walk_topsrcdir怎么用?Python BuildReader.walk_topsrcdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozbuild.frontend.reader.BuildReader
的用法示例。
在下文中一共展示了BuildReader.walk_topsrcdir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_docs
# 需要导入模块: from mozbuild.frontend.reader import BuildReader [as 别名]
# 或者: from mozbuild.frontend.reader.BuildReader import walk_topsrcdir [as 别名]
def build_docs(self, format=None, outdir=None):
self._activate_virtualenv()
self.virtualenv_manager.install_pip_package('mdn-sphinx-theme==0.4')
from moztreedocs import SphinxManager
if outdir == '<DEFAULT>':
outdir = os.path.join(self.topobjdir, 'docs')
manager = SphinxManager(self.topsrcdir, os.path.join(self.topsrcdir,
'tools', 'docs'), outdir)
# We don't care about GYP projects, so don't process them. This makes
# scanning faster and may even prevent an exception.
def remove_gyp_dirs(context):
context['GYP_DIRS'][:] = []
reader = BuildReader(self.config_environment,
sandbox_post_eval_cb=remove_gyp_dirs)
for context in reader.walk_topsrcdir():
for dest_dir, source_dir in context['SPHINX_TREES'].items():
manager.add_tree(os.path.join(context.relsrcdir,
source_dir), dest_dir)
for entry in context['SPHINX_PYTHON_PACKAGE_DIRS']:
manager.add_python_package_dir(os.path.join(context.relsrcdir,
entry))
return manager.generate_docs(format)