mirror of
https://github.com/edgewall/trac.git
synced 2026-02-05 09:46:44 +01:00
1.6.1dev: fix disappeared first positional argument of methods in Interface classes (closes #13599)
[skip ci] git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17908 af82e41b-90c4-0310-8c96-b1721e28e2e2
This commit is contained in:
17
doc/conf.py
17
doc/conf.py
@@ -372,6 +372,23 @@ def setup(app):
|
||||
return [node], []
|
||||
roles.register_canonical_role('extensionpoints', extensionpoints_role)
|
||||
|
||||
import inspect
|
||||
from sphinx.ext import autodoc
|
||||
from sphinx.util.inspect import stringify_signature
|
||||
|
||||
class MethodDocumenter(autodoc.MethodDocumenter):
|
||||
|
||||
def format_args(self, **kwargs):
|
||||
if isinstance(self.parent, type):
|
||||
if any(base.__module__ == 'trac.core' and
|
||||
base.__name__ == 'Interface'
|
||||
for base in self.parent.__bases__):
|
||||
sig = inspect.signature(self.object)
|
||||
return stringify_signature(sig)
|
||||
return super().format_args(**kwargs)
|
||||
|
||||
app.add_autodocumenter(MethodDocumenter, override=True)
|
||||
|
||||
# ifconfig variables
|
||||
app.add_config_value('devel', True, '')
|
||||
if html_jinja_lexer:
|
||||
|
||||
Reference in New Issue
Block a user