From bd36dc2f35df2f5625ca5086f23628480adf682a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 7 Dec 2012 15:48:49 -0500 Subject: [PATCH] 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. --- wsme/pecan.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wsme/pecan.py b/wsme/pecan.py index 7a478a8..e9ba454 100644 --- a/wsme/pecan.py +++ b/wsme/pecan.py @@ -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(