decorate(func, caller) decorates a function using a caller.
(func, caller)
| 227 | |
| 228 | |
| 229 | def decorate(func, caller): |
| 230 | """ |
| 231 | decorate(func, caller) decorates a function using a caller. |
| 232 | """ |
| 233 | evaldict = dict(_call_=caller, _func_=func) |
| 234 | fun = FunctionMaker.create( |
| 235 | func, "return _call_(_func_, %(shortsignature)s)", |
| 236 | evaldict, __wrapped__=func) |
| 237 | if hasattr(func, '__qualname__'): |
| 238 | fun.__qualname__ = func.__qualname__ |
| 239 | return fun |
| 240 | |
| 241 | |
| 242 | def decorator(caller, _func=None): |