sphinxext: Fix Sphinx 3.0 compatibility
Sphinx is currently issuing the following warnings for projects using this extension. RemovedInSphinx30Warning: sphinx.locale.l_() is deprecated. Please use `_()` instead. Head this off before it becomes an issue. Change-Id: I108d36ab909a7afd4fd28bfb565812f69ae02118 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
a54cdfb6c7
commit
2be89e587c
@ -10,7 +10,7 @@ from sphinx.ext import autodoc
|
|||||||
from sphinx.domains.python import PyClasslike, PyClassmember
|
from sphinx.domains.python import PyClasslike, PyClassmember
|
||||||
from sphinx.domains import Domain, ObjType
|
from sphinx.domains import Domain, ObjType
|
||||||
from sphinx.directives import ObjectDescription
|
from sphinx.directives import ObjectDescription
|
||||||
from sphinx.locale import l_, _
|
from sphinx.locale import _
|
||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util.docfields import Field
|
from sphinx.util.docfields import Field
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
@ -156,7 +156,7 @@ class TypeDirective(PyClasslike):
|
|||||||
|
|
||||||
class AttributeDirective(PyClassmember):
|
class AttributeDirective(PyClassmember):
|
||||||
doc_field_types = [
|
doc_field_types = [
|
||||||
Field('datatype', label=l_('Type'), has_arg=False,
|
Field('datatype', label=_('Type'), has_arg=False,
|
||||||
names=('type', 'datatype'))
|
names=('type', 'datatype'))
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ class TypeDocumenter(autodoc.ClassDocumenter):
|
|||||||
if protocols:
|
if protocols:
|
||||||
sample_obj = make_sample_object(self.object)
|
sample_obj = make_sample_object(self.object)
|
||||||
content.extend([
|
content.extend([
|
||||||
l_(u'Data samples:'),
|
_(u'Data samples:'),
|
||||||
u'',
|
u'',
|
||||||
u'.. cssclass:: toggle',
|
u'.. cssclass:: toggle',
|
||||||
u''
|
u''
|
||||||
@ -441,7 +441,7 @@ def document_function(funcdef, docstrings=None, protocols=['restjson']):
|
|||||||
make_sample_object(arg.datatype)
|
make_sample_object(arg.datatype)
|
||||||
))
|
))
|
||||||
codesamples.extend([
|
codesamples.extend([
|
||||||
u':%s:' % l_(u'Parameters samples'),
|
u':%s:' % _(u'Parameters samples'),
|
||||||
u' .. cssclass:: toggle',
|
u' .. cssclass:: toggle',
|
||||||
u''
|
u''
|
||||||
])
|
])
|
||||||
@ -460,7 +460,7 @@ def document_function(funcdef, docstrings=None, protocols=['restjson']):
|
|||||||
|
|
||||||
if funcdef.return_type:
|
if funcdef.return_type:
|
||||||
codesamples.extend([
|
codesamples.extend([
|
||||||
u':%s:' % l_(u'Return samples'),
|
u':%s:' % _(u'Return samples'),
|
||||||
u' .. cssclass:: toggle',
|
u' .. cssclass:: toggle',
|
||||||
u''
|
u''
|
||||||
])
|
])
|
||||||
@ -547,8 +547,8 @@ class WSMEDomain(Domain):
|
|||||||
label = 'WSME'
|
label = 'WSME'
|
||||||
|
|
||||||
object_types = {
|
object_types = {
|
||||||
'type': ObjType(l_('type'), 'type', 'obj'),
|
'type': ObjType(_('type'), 'type', 'obj'),
|
||||||
'service': ObjType(l_('service'), 'service', 'obj')
|
'service': ObjType(_('service'), 'service', 'obj')
|
||||||
}
|
}
|
||||||
|
|
||||||
directives = {
|
directives = {
|
||||||
|
Loading…
Reference in New Issue
Block a user