X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fbackends%2Fback_anydbm.py;h=5ea64da8956f9f76bf1daccdd1f7cc0bbaf3c4cf;hb=0aa09748fed02f351c030b3e1b2e00a9eda2f472;hp=0ee8fbbcf65776e67f64c88ec6e12f2097a8f3a1;hpb=f04ca7e8c6067e05296508ed2b7c302425ffbcc8;p=roundup.git diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 0ee8fbb..5ea64da 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -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.34 2002-05-15 06:21:21 richard Exp $ +#$Id: back_anydbm.py,v 1.35 2002-05-25 07:16:24 rochecompaan 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 @@ -26,6 +26,7 @@ serious bugs, and is not available) import whichdb, anydbm, os, marshal from roundup import hyperdb, date from blobfiles import FileStorage +from roundup.roundup_indexer import RoundupIndexer from locking import acquire_lock, release_lock # @@ -61,6 +62,7 @@ class Database(FileStorage, hyperdb.Database): self.dirtynodes = {} # keep track of the dirty nodes by class self.newnodes = {} # keep track of the new nodes by class self.transactions = [] + self.indexer = RoundupIndexer(self.dir) # ensure files are group readable and writable os.umask(0002) @@ -467,6 +469,9 @@ class Database(FileStorage, hyperdb.Database): def _doStoreFile(self, name, **databases): # the file is currently ".tmp" - move it to its real name to commit os.rename(name+".tmp", name) + pattern = name.split('/')[-1] + self.indexer.add_files(dir=os.path.dirname(name), pattern=pattern) + self.indexer.save_index() def rollback(self): ''' Reverse all actions from the current transaction. @@ -485,6 +490,14 @@ class Database(FileStorage, hyperdb.Database): # #$Log: not supported by cvs2svn $ +#Revision 1.34 2002/05/15 06:21:21 richard +# . 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) +# #Revision 1.33 2002/04/24 10:38:26 rochecompaan #All database files are now created group readable and writable. # @@ -502,6 +515,9 @@ class Database(FileStorage, hyperdb.Database): # #Unit tests for all of the above written. # +#Revision 1.30.2.1 2002/04/03 11:55:57 rochecompaan +# . Added feature #526730 - search for messages capability +# #Revision 1.30 2002/02/27 03:40:59 richard #Ran it through pychecker, made fixes #