mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Docs: Fix ugly nulljob repr in method signatures
This commit is contained in:
parent
97fcf1ffa8
commit
2fdfacb34e
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user