Fix Sphinx 2 new API for Fedora 31+
This commit is contained in:
parent
b4177cf7d2
commit
be1c193e3c
@ -41,12 +41,17 @@ import sphinx
|
||||
import sphinx.errors
|
||||
import sphinx.locale
|
||||
import sphinx.util.docfields
|
||||
from sphinx.util import logging
|
||||
|
||||
import qubes.tools
|
||||
|
||||
SUBCOMMANDS_TITLE = 'COMMANDS'
|
||||
OPTIONS_TITLE = 'OPTIONS'
|
||||
|
||||
try:
|
||||
log = logging.getLogger(__name__)
|
||||
except AttributeError:
|
||||
log = None
|
||||
|
||||
class GithubTicket:
|
||||
# pylint: disable=too-few-public-methods
|
||||
@ -338,7 +343,13 @@ class ManpageCheckVisitor(docutils.nodes.SparseNodeVisitor):
|
||||
try:
|
||||
parser = qubes.tools.get_parser_for_command(command)
|
||||
except ImportError:
|
||||
app.warn('cannot import module for command')
|
||||
msg = 'cannot import module for command'
|
||||
if log:
|
||||
log.warning(msg)
|
||||
else:
|
||||
# Handle legacy
|
||||
app.warn(msg)
|
||||
|
||||
self.parser = None
|
||||
return
|
||||
except AttributeError:
|
||||
@ -394,7 +405,13 @@ def check_man_args(app, doctree, docname):
|
||||
if os.path.basename(dirname) != 'manpages':
|
||||
return
|
||||
|
||||
app.info('Checking arguments for {!r}'.format(command))
|
||||
msg = 'Checking arguments for {!r}'.format(command)
|
||||
if log:
|
||||
log.info(msg)
|
||||
else:
|
||||
# Handle legacy
|
||||
app.info(msg)
|
||||
|
||||
doctree.walk(ManpageCheckVisitor(app, command, doctree))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user