Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f18b77
)
Try to unwrap functions passed to funplex.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 4 Jun 2013 13:21:56 +0000
(15:21 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 4 Jun 2013 13:21:56 +0000
(15:21 +0200)
wrw/util.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/util.py
b/wrw/util.py
index
e601be3
..
4306e9b
100644
(file)
--- 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 == "":