Merge pull request #1483 from untitaker/improve-autodoc
Show original autodoc signatures
This commit is contained in:
commit
5c68b24f64
1 changed files with 21 additions and 0 deletions
21
docs/conf.py
21
docs/conf.py
|
|
@ -269,3 +269,24 @@ except ImportError, e:
|
|||
pygments_style = 'tango'
|
||||
html_theme = 'default'
|
||||
html_theme_options = {}
|
||||
|
||||
|
||||
# unwrap decorators
|
||||
def unwrap_decorators():
|
||||
import sphinx.util.inspect as inspect
|
||||
import functools
|
||||
|
||||
old_getargspec = inspect.getargspec
|
||||
def getargspec(x):
|
||||
return old_getargspec(getattr(x, '_original_function', x))
|
||||
inspect.getargspec = getargspec
|
||||
|
||||
old_update_wrapper = functools.update_wrapper
|
||||
def update_wrapper(wrapper, wrapped, *a, **kw):
|
||||
rv = old_update_wrapper(wrapper, wrapped, *a, **kw)
|
||||
rv._original_function = wrapped
|
||||
return rv
|
||||
functools.update_wrapper = update_wrapper
|
||||
|
||||
unwrap_decorators()
|
||||
del unwrap_decorators
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue