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:
241bc38
)
Added an explicit get function to session databases.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 1 Dec 2011 20:26:54 +0000
(21:26 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 1 Dec 2011 20:26:54 +0000
(21:26 +0100)
wrw/session.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/session.py
b/wrw/session.py
index
9e91ad9
..
284d092
100644
(file)
--- a/
wrw/session.py
+++ b/
wrw/session.py
@@
-134,7
+134,7
@@
class db(object):
return sess
def ckfreeze(self, req):
return sess
def ckfreeze(self, req):
- sess =
req.item(self.fetch
)
+ sess =
self.get(req
)
if sess.dirty():
try:
if getattr(sess, "new", False):
if sess.dirty():
try:
if getattr(sess, "new", False):
@@
-150,6
+150,9
@@
class db(object):
def freeze(self, sess):
raise TypeError()
def freeze(self, sess):
raise TypeError()
+ def get(self, req):
+ return req.item(self.fetch)
+
class backeddb(db):
def __init__(self, backdb, *args, **kw):
super(backeddb, self).__init__(*args, **kw)
class backeddb(db):
def __init__(self, backdb, *args, **kw):
super(backeddb, self).__init__(*args, **kw)
@@
-186,4
+189,4
@@
class dirback(object):
default = backeddb(dirback(os.path.join("/tmp", "wrwsess-" + str(os.getuid()))))
def get(req):
default = backeddb(dirback(os.path.join("/tmp", "wrwsess-" + str(os.getuid()))))
def get(req):
- return
req.item(default.fetch
)
+ return
default.get(req
)