本文整理汇总了Python中sphinx.setup_command.BuildDoc.finalize_options方法的典型用法代码示例。如果您正苦于以下问题:Python BuildDoc.finalize_options方法的具体用法?Python BuildDoc.finalize_options怎么用?Python BuildDoc.finalize_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.setup_command.BuildDoc
的用法示例。
在下文中一共展示了BuildDoc.finalize_options方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
# Clear out previous sphinx builds, if requested
if self.clean_docs:
dirstorm = [os.path.join(self.source_dir, "api")]
if self.build_dir is None:
dirstorm.append("docs/_build")
else:
dirstorm.append(self.build_dir)
for d in dirstorm:
if os.path.isdir(d):
log.info("Cleaning directory " + d)
shutil.rmtree(d)
else:
log.info("Not cleaning directory " + d + " because " "not present or not a directory")
SphinxBuildDoc.finalize_options(self)
示例2: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
from os.path import isfile
from distutils.cmd import DistutilsOptionError
if self.build_dir is not None:
if isfile(self.build_dir):
raise DistutilsOptionError('Attempted to build_sphinx into a file '+self.build_dir)
self.mkpath(self.build_dir)
return BuildDoc.finalize_options(self)
示例3: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
# Clear out previous sphinx builds, if requested
if self.clean_docs:
dirstorm = [os.path.join(self.source_dir, 'api'),
os.path.join(self.source_dir, 'generated')]
if self.build_dir is None:
dirstorm.append('docs/_build')
else:
dirstorm.append(self.build_dir)
for d in dirstorm:
if os.path.isdir(d):
log.info('Cleaning directory ' + d)
shutil.rmtree(d)
else:
log.info('Not cleaning directory ' + d + ' because '
'not present or not a directory')
SphinxBuildDoc.finalize_options(self)
示例4: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
from os.path import isdir
from shutil import rmtree
# Clear out previous sphinx builds, if requested
if self.clean_docs:
dirstorm = ["docs/_generated"]
if self.build_dir is None:
dirstorm.append("docs/_build")
else:
dirstorm.append(self.build_dir)
for d in dirstorm:
if isdir(d):
log.info("Cleaning directory " + d)
rmtree(d)
else:
log.info("Not cleaning directory " + d + " because " "not present or not a directory")
BuildDoc.finalize_options(self)
示例5: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
from os.path import isdir
from shutil import rmtree
#Clear out previous sphinx builds, if requested
if self.clean_docs:
dirstorm = ['docs/_generated']
if self.build_dir is None:
dirstorm.append('docs/_build')
else:
dirstorm.append(self.build_dir)
for d in dirstorm:
if isdir(d):
log.info('Cleaning directory ' + d)
rmtree(d)
else:
log.info('Not cleaning directory ' + d + ' because '
'not present or not a directory')
SphinxBuildDoc.finalize_options(self)
示例6: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
""" Override the default for the documentation build
directory.
"""
self.build_dir = os.path.join(*DOC_BUILD_DIR.split(os.sep)[:-1])
BuildDoc.finalize_options(self)
示例7: finalize_options
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import finalize_options [as 别名]
def finalize_options(self):
BuildDoc.finalize_options(self)