comparison roundup/backends/back_anydbm.py @ 252:76c6994aa4e8

CGI interfaces now spit up a top-level index of all instances they can serve.
author Richard Jones <richard@users.sourceforge.net>
date Sat, 29 Sep 2001 13:27:00 +0000
parents ad2c98faec97
children a4241ddd22d7
comparison
equal deleted inserted replaced
251:2f4123c715f1 252:76c6994aa4e8
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 #$Id: back_anydbm.py,v 1.7 2001-08-12 06:32:36 richard Exp $ 18 #$Id: back_anydbm.py,v 1.8 2001-09-29 13:27:00 richard Exp $
19 19
20 import anydbm, os, marshal 20 import anydbm, os, marshal
21 from roundup import hyperdb, date 21 from roundup import hyperdb, date
22 22
23 # 23 #
39 None, the database is opened in read-only mode: the Class.create(), 39 None, the database is opened in read-only mode: the Class.create(),
40 Class.set(), and Class.retire() methods are disabled. 40 Class.set(), and Class.retire() methods are disabled.
41 """ 41 """
42 self.dir, self.journaltag = storagelocator, journaltag 42 self.dir, self.journaltag = storagelocator, journaltag
43 self.classes = {} 43 self.classes = {}
44 self.transactions = []
44 45
45 # 46 #
46 # Classes 47 # Classes
47 # 48 #
48 def __getattr__(self, classname): 49 def __getattr__(self, classname):
201 202
202 203
203 # 204 #
204 # Basic transaction support 205 # Basic transaction support
205 # 206 #
206 # TODO: well, write these methods (and then use them in other code)
207 def register_action(self):
208 ''' Register an action to the transaction undo log
209 '''
210
211 def commit(self): 207 def commit(self):
212 ''' Commit the current transaction, start a new one 208 ''' Commit the current transactions.
213 ''' 209 '''
210 # lock the DB
211 for action, classname, entry in self.transactions:
212 # write the node, figure what's changed for the journal.
213 pass
214 # unlock the DB
214 215
215 def rollback(self): 216 def rollback(self):
216 ''' Reverse all actions from the current transaction 217 ''' Reverse all actions from the current transaction.
217 ''' 218 '''
219 self.transactions = []
218 220
219 # 221 #
220 #$Log: not supported by cvs2svn $ 222 #$Log: not supported by cvs2svn $
223 #Revision 1.7 2001/08/12 06:32:36 richard
224 #using isinstance(blah, Foo) now instead of isFooType
225 #
221 #Revision 1.6 2001/08/07 00:24:42 richard 226 #Revision 1.6 2001/08/07 00:24:42 richard
222 #stupid typo 227 #stupid typo
223 # 228 #
224 #Revision 1.5 2001/08/07 00:15:51 richard 229 #Revision 1.5 2001/08/07 00:15:51 richard
225 #Added the copyright/license notice to (nearly) all files at request of 230 #Added the copyright/license notice to (nearly) all files at request of

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