# HG changeset patch # User Richard Jones # Date 1024456039 0 # Node ID fb2ce2b8b2ef8d31f1946f9e6e26104f64fccb20 # Parent bcd284bba81fb0fad23db42b12f1cd034a57609a Moved the file storage commit into blobfiles where it belongs. diff -r bcd284bba81f -r fb2ce2b8b2ef roundup/backends/back_anydbm.py --- a/roundup/backends/back_anydbm.py Tue Jun 18 03:59:59 2002 +0000 +++ b/roundup/backends/back_anydbm.py Wed Jun 19 03:07:19 2002 +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.35 2002-05-25 07:16:24 rochecompaan Exp $ +#$Id: back_anydbm.py,v 1.36 2002-06-19 03:07:19 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 @@ -466,13 +466,6 @@ db[nodeid] = marshal.dumps(l) - 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. ''' @@ -490,6 +483,9 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.35 2002/05/25 07:16:24 rochecompaan +#Merged search_indexing-branch with HEAD +# #Revision 1.34 2002/05/15 06:21:21 richard # . node caching now works, and gives a small boost in performance # diff -r bcd284bba81f -r fb2ce2b8b2ef roundup/backends/blobfiles.py --- a/roundup/backends/blobfiles.py Tue Jun 18 03:59:59 2002 +0000 +++ b/roundup/backends/blobfiles.py Wed Jun 19 03:07:19 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: blobfiles.py,v 1.3 2002-02-27 07:33:34 grubert Exp $ +#$Id: blobfiles.py,v 1.4 2002-06-19 03:07:19 richard Exp $ ''' This module exports file storage for roundup backends. Files are stored into a directory hierarchy. @@ -102,10 +102,17 @@ return files_in_dir(files_dir) def _doStoreFile(self, name, **databases): - '''Must be implemented by subclass + '''Store the file as part of a transaction commit. ''' - raise NotImplementedError + # 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() # $Log: not supported by cvs2svn $ +# Revision 1.3 2002/02/27 07:33:34 grubert +# . add, vim line and cvs log key. +# # # vim: set filetype=python ts=4 sw=4 et si