Copy properties to decorator

Use functools.wraps() to copy the docstring and name
from the decorated function to the closure so
the autodoc code gets the right values.
This commit is contained in:
Doug Hellmann 2012-12-07 15:48:49 -05:00
parent 6af9b92878
commit bd36dc2f35

View File

@ -1,5 +1,6 @@
from __future__ import absolute_import
import functools
import inspect
import sys
@ -57,6 +58,7 @@ def wsexpose(*args, **kwargs):
funcdef = wsme.api.FunctionDefinition.get(f)
funcdef.resolve_types(wsme.types.registry)
@functools.wraps(f)
def callfunction(self, *args, **kwargs):
try:
args, kwargs = wsme.rest.args.get_args(