From: Fredrik Tolf Date: Tue, 4 Jun 2013 13:21:56 +0000 (+0200) Subject: Try to unwrap functions passed to funplex. X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=24e514f00716cf4dd5fae2930d5f32e59bde2422 Try to unwrap functions passed to funplex. --- diff --git a/wrw/util.py b/wrw/util.py index e601be3..4306e9b 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -25,8 +25,12 @@ def formparams(callable): return wrapper def funplex(*funs, **nfuns): + def unwrap(fun): + while hasattr(fun, "__wrapped__"): + fun = fun.__wrapped__ + return fun dir = {} - dir.update(((fun.__name__, fun) for fun in funs)) + dir.update(((unwrap(fun).__name__, fun) for fun in funs)) dir.update(nfuns) def handler(req): if req.pathinfo == "":