Mercurial > p > roundup > code
diff roundup/backends/back_bsddb.py @ 719:fed4c363a7f3
node caching now works, and gives a small boost in performance
As a part of this, I cleaned up the DEBUG output and implemented TRACE
output (HYPERDBTRACE='file to trace to') with checkpoints at the start of
CGI requests. Run roundup with python -O to skip all the DEBUG/TRACE stuff
(using if __debug__ which is compiled out with -O)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 15 May 2002 06:21:21 +0000 |
| parents | bc46480e2a2b |
| children | 2dd862af72ee 8adaf5d169da |
line wrap: on
line diff
--- a/roundup/backends/back_bsddb.py Wed May 15 03:27:16 2002 +0000 +++ b/roundup/backends/back_bsddb.py Wed May 15 06:21:21 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.17 2002-04-03 05:54:31 richard Exp $ +#$Id: back_bsddb.py,v 1.18 2002-05-15 06:21:21 richard Exp $ ''' This module defines a backend that saves the hyperdatabase in BSDDB. ''' @@ -55,18 +55,18 @@ '''Low-level database opener that gets around anydbm/dbm eccentricities. ''' - if hyperdb.DEBUG: - print self, '_opendb', (self, name, mode) + if __debug__: + print >>hyperdb.DEBUG, self, '_opendb', (self, name, mode) # determine which DB wrote the class file path = os.path.join(os.getcwd(), self.dir, name) if not os.path.exists(path): - if hyperdb.DEBUG: - print "_opendb bsddb.open(%r, 'n')"%path + if __debug__: + print >>hyperdb.DEBUG, "_opendb bsddb.open(%r, 'n')"%path return bsddb.btopen(path, 'n') # open the database with the correct module - if hyperdb.DEBUG: - print "_opendb bsddb.open(%r, %r)"%(path, mode) + if __debug__: + print >>hyperdb.DEBUG, "_opendb bsddb.open(%r, %r)"%(path, mode) return bsddb.btopen(path, mode) # @@ -102,8 +102,8 @@ entry = (nodeid, date.Date().get_tuple(), self.journaltag, action, params) - if hyperdb.DEBUG: - print '_doSaveJournal', entry + if __debug__: + print >>hyperdb.DEBUG, '_doSaveJournal', entry db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'c') @@ -119,6 +119,14 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.17 2002/04/03 05:54:31 richard +#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. +# #Revision 1.16 2002/02/27 03:40:59 richard #Ran it through pychecker, made fixes #
