- import inspect
- from . import req, dispatch, session, form, resp
+ import inspect, math
-import req, dispatch, session, form, resp, proto
++from . import req, dispatch, session, form, resp, proto
def wsgiwrap(callable):
def wrapper(env, startreq):
return dispatch.handleenv(env, startreq, callable)
+ wrapper.__wrapped__ = callable
return wrapper
+def stringwrap(charset):
+ def dec(callable):
+ def wrapper(*args, **kwargs):
+ bk = callable(*args, **kwargs)
+ for string in bk:
+ yield string.encode(charset)
+ return wrapper
+ return dec
+
def formparams(callable):
def wrapper(req):
data = form.formdata(req)