Solve the error: 'Sphinx' object has no attribute 'info'

This problem has been discussed in this web:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004462.html

This solution like nova:
https://review.openstack.org/#/c/648670/

Change-Id: I15e8d731417c041499338ada29c1b7fe5f0715f4
This commit is contained in:
chenke 2019-04-04 15:39:40 +08:00
parent e4da124770
commit e43594e185
3 changed files with 13 additions and 16 deletions

View File

@ -33,7 +33,7 @@ extensions = ['redirect',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.mathjax',
'oslosphinx',
'openstackdocstheme',
'yasfb',
]
@ -103,7 +103,7 @@ man_pages = []
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'nature'
html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the

View File

@ -5,15 +5,9 @@
import os.path
from sphinx.application import ENV_PICKLE_FILENAME
from sphinx.util.console import bold
from sphinx.util import logging
def setup(app):
from sphinx import application
if not isinstance(app, application.Sphinx):
return
app.connect('build-finished', emit_redirects)
LOG = logging.getLogger(__name__)
def process_redirect_file(app, path, ent):
@ -35,7 +29,7 @@ def process_redirect_file(app, path, ent):
def emit_redirects(app, exc):
app.builder.info(bold('scanning %s for redirects...') % app.builder.srcdir)
LOG.info('scanning %s for redirects...', app.builder.srcdir)
def process_directory(path):
for ent in os.listdir(path):
@ -43,8 +37,12 @@ def emit_redirects(app, exc):
if os.path.isdir(p):
process_directory(p)
elif ent == 'redirects':
app.builder.info(' found redirects at %s' % p)
LOG.info(' found redirects at %s' % p)
process_redirect_file(app, path, ent)
process_directory(app.builder.srcdir)
app.builder.info('...done')
LOG.info('...done')
def setup(app):
app.connect('build-finished', emit_redirects)

View File

@ -1,6 +1,5 @@
oslosphinx
pbr>=2.0.0,!=2.1.0 # Apache-2.0
sphinx>=1.6.2 # BSD
testtools>=1.4.0
yasfb>=0.5.1
doc8 # Apache-2.0
yasfb>=0.8.0
openstackdocstheme>=1.19.0 # Apache-2.0