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:
09beae7
)
Fixed stringwrap iteration bug.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 2 Mar 2014 04:12:14 +0000
(
05:12
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 2 Mar 2014 04:12:14 +0000
(
05:12
+0100)
wrw/util.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/util.py
b/wrw/util.py
index
8eed5a0
..
7c42eae
100644
(file)
--- a/
wrw/util.py
+++ b/
wrw/util.py
@@
-7,16
+7,6
@@
def wsgiwrap(callable):
wrapper.__wrapped__ = callable
return wrapper
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)
- wrapper.__wrapped__ = callable
- return wrapper
- return dec
-
def formparams(callable):
spec = inspect.getargspec(callable)
def wrapper(req):
def formparams(callable):
spec = inspect.getargspec(callable)
def wrapper(req):
@@
-120,6
+110,16
@@
def pregen(callable):
wrapper.__wrapped__ = callable
return wrapper
wrapper.__wrapped__ = callable
return wrapper
+def stringwrap(charset):
+ def dec(callable):
+ @pregen
+ def wrapper(*args, **kwargs):
+ for string in callable(*args, **kwargs):
+ yield string.encode(charset)
+ wrapper.__wrapped__ = callable
+ return wrapper
+ return dec
+
class sessiondata(object):
@classmethod
def get(cls, req, create=True):
class sessiondata(object):
@classmethod
def get(cls, req, create=True):