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


Python Sphinx._warncount方法代码示例

本文整理汇总了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
开发者ID:adamchainz,项目名称:galley,代码行数:57,代码来源:worker.py


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