本文整理汇总了Python中vilya.models.sphinx_docs.SphinxDocs.last_build_info方法的典型用法代码示例。如果您正苦于以下问题:Python SphinxDocs.last_build_info方法的具体用法?Python SphinxDocs.last_build_info怎么用?Python SphinxDocs.last_build_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.sphinx_docs.SphinxDocs
的用法示例。
在下文中一共展示了SphinxDocs.last_build_info方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pages_mode
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def test_pages_mode(self):
prj = self._prj()
self._add(prj, "code_config.yaml", self.conf)
self._add(prj, "pages/index.html", self.html1)
sd = SphinxDocs(prj.name)
assert sd.builders == ["pages"]
assert sd.last_build_info() is None
sd.build_all()
assert sd.last_build_info()["status"] == "success"
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content("index.html", {}) == self.html1
示例2: test_pages_mode
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def test_pages_mode(self):
prj = self._prj()
self._add(prj, 'code_config.yaml', self.conf)
self._add(prj, 'pages/index.html', self.html1)
sd = SphinxDocs(prj.name)
assert sd.builders == [self.builder]
assert sd.last_build_info() is None
sd.build_all()
assert sd.last_build_info()['status'] == 'success'
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content('index.html', {}) == self.html1
示例3: test_build_info
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def test_build_info(self):
prj = self._prj()
self._add(prj, 'docs/index.rst', base_index_rst)
self._add(prj, 'docs/doc1.rst', base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
bi = sd.last_build_info()
assert bi['status'] == 'success'
示例4: test_build_info
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def test_build_info(self):
prj = self._prj()
self._add(prj, "code_config.yaml", base_yaml_conf)
self._add(prj, "index.rst", base_index_rst)
self._add(prj, "doc1.rst", base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
bi = sd.last_build_info()
assert bi["status"] == "success"
示例5: test_pages_no_docsdir
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def test_pages_no_docsdir(self):
prj = self._prj()
self._add(prj, "code_config.yaml", self.conf)
self._add(prj, "pagesNOT_THE_SAME/index.html", self.html1)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.last_build_info()["status"] == "no_doc_dir_found"
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content("index.html", {}) is False
示例6: pages
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def pages(self, request):
user = request.user
docs = SphinxDocs(self.proj_name)
tdt = {
'project': CodeDoubanProject.get_by_name(self.proj_name),
'request': request,
'user': user,
'docs': docs,
'last_build': docs.last_build_info(),
}
return st('settings/pages.html', **tdt)
示例7: sphinx_docs
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import last_build_info [as 别名]
def sphinx_docs(self, request):
user = request.user
docs = SphinxDocs(self.proj_name)
if request.get_form_var('force_rebuild') == 'mq':
sphinx_builds_add(self.proj_name)
return request.redirect(
'/%s/settings/sphinx_docs' % self.proj_name)
if request.get_form_var('force_rebuild') == 'direct':
docs.build_all()
return request.redirect(
'/%s/settings/sphinx_docs' % self.proj_name)
tdt = {
'project': CodeDoubanProject.get_by_name(self.proj_name),
'request': request,
'enabled': docs.enabled,
'last_build': docs.last_build_info(),
'user': user,
}
return st('settings/sphinx_docs.html', **tdt)