Dolda2000 GitWeb
/
wrw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Try to unwrap functions passed to funplex.
[wrw.git]
/
wrw
/
util.py
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):
return wrapper
def funplex(*funs, **nfuns):
+ def unwrap(fun):
+ while hasattr(fun, "__wrapped__"):
+ fun = fun.__wrapped__
+ return fun
dir = {}
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 == "":
dir.update(nfuns)
def handler(req):
if req.pathinfo == "":