Use the environment to configure session and skel defaults as well.
[wrw.git] / wrw / session.py
index 7632449..1239ecd 100644 (file)
@@ -1,5 +1,5 @@
 import threading, time, pickle, random, os
-import cookie
+import cookie, env
 
 __all__ = ["db", "get"]
 
@@ -180,7 +180,7 @@ class dirback(object):
         with open(os.path.join(self.path, key), "w") as out:
             out.write(value)
 
-default = db(backdb = dirback(os.path.join("/tmp", "wrwsess-" + str(os.getuid()))))
+default = env.var(db(backdb = dirback(os.path.join("/tmp", "wrwsess-" + str(os.getuid())))))
 
 def get(req):
-    return default.get(req)
+    return default.val.get(req)