From: richard Date: Wed, 19 Jun 2002 03:07:19 +0000 (+0000) Subject: Moved the file storage commit into blobfiles where it belongs. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=782c6fb55542f0b10001ef5e19cfbcf64c6de290;p=roundup.git Moved the file storage commit into blobfiles where it belongs. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@791 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 5ea64da..60159cd 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.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 @@ class Database(FileStorage, hyperdb.Database): 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 @@ class Database(FileStorage, hyperdb.Database): # #$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 --git a/roundup/backends/blobfiles.py b/roundup/backends/blobfiles.py index ccf3976..3f110e5 100644 --- a/roundup/backends/blobfiles.py +++ b/roundup/backends/blobfiles.py @@ -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 @@ class FileStorage: 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