diff roundup/backends/back_anydbm.py @ 2082:c091cacdc505

Finished implementation of session and one-time-key stores for RDBMS backends. Refactored the API of sessions and their interaction with the backend database a fair bit too. Added some session tests. Nothing testing ageing yet, 'cos that's a pain inna ass to test :) Note: metakit backend still uses the *dbm implementation. It might want to implement its own session store some day, as it'll be faster than the *dbm one.
author Richard Jones <richard@users.sourceforge.net>
date Thu, 18 Mar 2004 01:58:46 +0000
parents 3e0961d6d44d
children 93f03c6714d8
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Wed Mar 17 22:01:37 2004 +0000
+++ b/roundup/backends/back_anydbm.py	Thu Mar 18 01:58:46 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_anydbm.py,v 1.137 2004-03-15 05:50:20 richard Exp $
+#$Id: back_anydbm.py,v 1.138 2004-03-18 01:58:45 richard Exp $
 '''This module defines a backend that saves the hyperdatabase in a
 database chosen by anydbm. It is guaranteed to always be available in python
 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -36,7 +36,7 @@
 import whichdb, os, marshal, re, weakref, string, copy
 from roundup import hyperdb, date, password, roundupdb, security
 from blobfiles import FileStorage
-from sessions import Sessions, OneTimeKeys
+from sessions_dbm import Sessions, OneTimeKeys
 from roundup.indexer import Indexer
 from roundup.backends import locking
 from roundup.hyperdb import String, Password, Date, Interval, Link, \
@@ -79,8 +79,6 @@
         self.destroyednodes = {}# keep track of the destroyed nodes by class
         self.transactions = []
         self.indexer = Indexer(self.dir)
-        self.sessions = Sessions(self.config)
-        self.otks = OneTimeKeys(self.config)
         self.security = security.Security(self)
         # ensure files are group readable and writable
         os.umask(0002)
@@ -103,6 +101,12 @@
         """
         self.reindex()
 
+    def getSessionManager(self):
+        return Sessions(self)
+
+    def getOTKManager(self):
+        return OneTimeKeys(self)
+
     def reindex(self):
         for klass in self.classes.values():
             for nodeid in klass.list():

Roundup Issue Tracker: http://roundup-tracker.org/