本文整理汇总了Python中sphinx.application.Sphinx._warncount方法的典型用法代码示例。如果您正苦于以下问题:Python Sphinx._warncount方法的具体用法?Python Sphinx._warncount怎么用?Python Sphinx._warncount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.application.Sphinx
的用法示例。
在下文中一共展示了Sphinx._warncount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sphinx_worker
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import _warncount [as 别名]
def sphinx_worker(base_path, work_queue, output_queue):
"A background worker thread performing Sphinx compilations"
# Set up the Sphinx instance
srcdir = base_path
confdir = srcdir
outdir = os.path.join(srcdir, '_build', 'json')
freshenv = False
warningiserror = False
buildername = 'json'
# verbosity = 0
# parallel = 0
status = SphinxStatusHandler(output_queue)
warning = SphinxWarningHandler(output_queue)
# error = sys.stderr
# warnfile = None
confoverrides = {}
tags = []
doctreedir = os.path.join(outdir, '.doctrees')
output_queue.put(InitializationStart())
sphinx = Sphinx(srcdir, confdir, outdir, doctreedir, buildername,
confoverrides, status, warning, freshenv,
warningiserror, tags)
output_queue.put(InitializationEnd(extension=sphinx.config.source_suffix))
quit = False
while not quit:
# Get the next command off the work queue
cmd = work_queue.get(block=True)
if isinstance(cmd, Quit):
quit = True
elif isinstance(cmd, ReloadConfig):
output_queue.put(InitializationStart())
freshenv = True
sphinx = Sphinx(srcdir, confdir, outdir, doctreedir, buildername,
confoverrides, status, warning, freshenv,
warningiserror, tags)
output_queue.put(InitializationEnd(extension=sphinx.config.source_suffix))
elif isinstance(cmd, BuildAll):
output_queue.put(BuildStart(filenames=None))
sphinx.builder.build_all()
output_queue.put(BuildEnd(filenames=None))
elif isinstance(cmd, BuildSpecific):
output_queue.put(BuildStart(filenames=cmd.filenames))
sphinx.builder.build_specific(cmd.filenames)
output_queue.put(BuildEnd(filenames=cmd.filenames))
# Reset the warning count so that they don't accumulate between builds.
sphinx._warncount = 0