Add autodoc-process-signature to sphinx.events
This commit is contained in:
parent
bcae073fff
commit
7d80372bac
@ -11,11 +11,15 @@
|
|||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
|
import sphinx.events
|
||||||
import sys
|
import sys
|
||||||
import inspect
|
import inspect
|
||||||
import enchant
|
import enchant
|
||||||
import django
|
import django
|
||||||
|
|
||||||
|
|
||||||
|
sphinx.events.core_events['autodoc-process-signature'] = ''
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('../../'))
|
sys.path.insert(0, os.path.abspath('../../'))
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'access_controller.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'access_controller.settings')
|
||||||
@ -47,6 +51,8 @@ author = 'SHP S101, group 2'
|
|||||||
release = 'v0.01'
|
release = 'v0.01'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
def process_django_models(app, what, name, obj, options, lines):
|
def process_django_models(app, what, name, obj, options, lines):
|
||||||
@ -112,8 +118,9 @@ def skip_queryset(app, what, name, obj, skip, options):
|
|||||||
return skip
|
return skip
|
||||||
|
|
||||||
|
|
||||||
def fix_sig(app, what, name, obj, options, signature, return_annotation):
|
def process_signature(app, what: str, name: str, obj, options, signature, return_annotation):
|
||||||
return "", ""
|
if not callable(obj):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
@ -121,7 +128,7 @@ def setup(app):
|
|||||||
app.connect('autodoc-process-docstring', process_django_models)
|
app.connect('autodoc-process-docstring', process_django_models)
|
||||||
app.connect('autodoc-skip-member', skip_queryset)
|
app.connect('autodoc-skip-member', skip_queryset)
|
||||||
app.connect('autodoc-process-docstring', process_modules)
|
app.connect('autodoc-process-docstring', process_modules)
|
||||||
app.connect("autodoc-process-signature", fix_sig)
|
app.connect("autodoc-process-signature", process_signature)
|
||||||
|
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user