本文整理汇总了Python中sphinx.application.Sphinx.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Sphinx.__init__方法的具体用法?Python Sphinx.__init__怎么用?Python Sphinx.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.application.Sphinx
的用法示例。
在下文中一共展示了Sphinx.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import __init__ [as 别名]
def __init__(self, srcdir=None, buildername='html', confoverrides={}):
self.cleanup_dirs = []
self.readonly = False
# source settings
if srcdir is None:
srcdir = tempfile.mkdtemp()
self.cleanup_dirs.append(srcdir)
open(os.path.join(srcdir, 'conf.py'), 'w').close()
else:
self.readonly = True
if not srcdir.startswith('/'):
srcdir = os.path.join(testdir, srcdir)
confdir = srcdir
# _build/ directory setings
self.builddir = tempfile.mkdtemp()
outdir = os.path.join(self.builddir, str(buildername))
doctreedir = os.path.join(self.builddir, 'doctrees')
os.mkdir(outdir)
self.cleanup_dirs.append(self.builddir)
# misc settings
status = sys.stdout
warning = sys.stdout
Sphinx.__init__(self, srcdir, confdir, outdir, doctreedir,
buildername, confoverrides, status, warning)
示例2: __init__
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import __init__ [as 别名]
def __init__(self):
if not exists(self.on_the_fly_doc_dir):
os.mkdir(self.on_the_fly_doc_dir)
Sphinx.__init__(self,
srcdir = self.on_the_fly_doc_dir,
confdir = openalea.misc.__path__[0],
outdir = self.on_the_fly_doc_dir,
doctreedir = self.on_the_fly_doc_dir,
buildername = None,
freshenv = True)