+ if self._params_decoration:\r
+ for dec in self._params_decoration:\r
+ try:\r
+ args, kwargs = dec(*args, **kwargs)\r
+ except ReturnImediatelyException, e:\r
+ return e.ret\r
+\r
+ res = self._callable(*args, **kwargs)\r
+\r
+ if self._result_decoration:\r
+ for dec in self._result_decoration:\r
+ if dec._needs_params:\r
+ res = dec(res, *args, **kwargs)\r
+ else:\r
+ res = dec(res)\r
+\r
+ return res\r
+\r
+class ReturnImediatelyException(Exception):\r
+ def __init__(self, ret):\r
+ super(Exception, self).__init__()\r
+ self.ret = ret\r
+\r
+def _check_decoratable(origin, install=True):\r
+ if not isinstance(origin, DecoratableObject):\r
+ if inspect.ismethod(origin) and not hasattr(origin, '_decoratable_obj'):\r
+ decoratable = DecoratableObject(origin)\r