-def decorate(origin, needs_origin=True):\r
- if inspect.ismethod(origin):\r
- return _decorate_method(origin, needs_origin)\r
+def _decorate_params(origin):\r
+ return decorate(origin, mode=DecoratableObject.MODE_PARAMS)\r
+\r
+decorate.params = _decorate_params\r
+\r
+def _decorate_result(origin):\r
+ return decorate(origin, mode=DecoratableObject.MODE_RESULT)\r
+\r
+decorate.result = _decorate_result\r
+\r
+def _decorate_with(fn):\r
+ def decorator(origin):\r
+ if not isinstance(origin, DecoratableObject):\r
+ decoratable = DecoratableObject(origin)\r
+ else:\r
+ decoratable = origin\r
+\r
+ decoratable._decorate(fn, True, False)\r
+ return decoratable\r
+ return decorator\r
+\r