Mercurial > p > roundup > code
diff roundup/backends/back_bsddb.py @ 676:bc46480e2a2b
Fixed serialisation problem...
...by moving the serialisation step out of the hyperdb.Class (get,
set) into the hyperdb.Database.
Also fixed htmltemplate after the showid changes I made yesterday.
Unit tests for all of the above written.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 03 Apr 2002 05:54:31 +0000 |
| parents | 9b2575610953 |
| children | fed4c363a7f3 |
line wrap: on
line diff
--- a/roundup/backends/back_bsddb.py Wed Apr 03 05:53:03 2002 +0000 +++ b/roundup/backends/back_bsddb.py Wed Apr 03 05:54:31 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_bsddb.py,v 1.16 2002-02-27 03:40:59 richard Exp $ +#$Id: back_bsddb.py,v 1.17 2002-04-03 05:54:31 richard Exp $ ''' This module defines a backend that saves the hyperdatabase in BSDDB. ''' @@ -95,20 +95,33 @@ return res def _doSaveJournal(self, classname, nodeid, action, params): + # serialise first + if action in ('set', 'create'): + params = self.serialise(classname, params) + entry = (nodeid, date.Date().get_tuple(), self.journaltag, action, params) + + if hyperdb.DEBUG: + print '_doSaveJournal', entry + db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'c') + if db.has_key(nodeid): s = db[nodeid] l = marshal.loads(s) l.append(entry) else: l = [entry] + db[nodeid] = marshal.dumps(l) db.close() # #$Log: not supported by cvs2svn $ +#Revision 1.16 2002/02/27 03:40:59 richard +#Ran it through pychecker, made fixes +# #Revision 1.15 2002/02/16 09:15:33 richard #forgot to patch bsddb backend too #
