Docs: Fix ugly nulljob repr in method signatures

This commit is contained in:
Virgil Dupras 2013-10-11 12:15:02 -04:00
parent 97fcf1ffa8
commit 2fdfacb34e
1 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,7 @@
# serve to show the default.
import sys, os
import re
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@ -20,6 +21,16 @@ import sys, os
# for autodocs
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
# -- Misc fixes for autodoc
def fix_nulljob_in_sig(app, what, name, obj, options, signature, return_annotation):
if signature:
signature = re.sub(r"<jobprogress.job.NullJob object at 0x[\da-f]+>", "nulljob", signature)
return signature, return_annotation
def setup(app):
app.connect('autodoc-process-signature', fix_nulljob_in_sig)
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.