X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Futil.py;h=b8461d1d10089cc7aa0922004bf993e7b2fcd4ed;hb=313cc8f23e7a5656a6d2ad9e56e94e0e119c8f85;hp=e338e2c7a1e9e9dad57ef4e79aa549b3c47c5034;hpb=f9e9a7b5b192adfc7318e7f3ba0153668eef3bc1;p=wrw.git diff --git a/wrw/util.py b/wrw/util.py index e338e2c..b8461d1 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -6,6 +6,15 @@ def wsgiwrap(callable): return dispatch.handle(req.origrequest(env), startreq, 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) @@ -50,7 +59,7 @@ class sessiondata(object): @classmethod def sessdb(cls): - return session.default + return session.default.val class autodirty(sessiondata): @classmethod