comparison roundup/backends/blobfiles.py @ 778:fb2ce2b8b2ef

Moved the file storage commit into blobfiles where it belongs.
author Richard Jones <richard@users.sourceforge.net>
date Wed, 19 Jun 2002 03:07:19 +0000
parents 66b324f895d1
children 254b8d112eec
comparison
equal deleted inserted replaced
777:bcd284bba81f 778:fb2ce2b8b2ef
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 #$Id: blobfiles.py,v 1.3 2002-02-27 07:33:34 grubert Exp $ 18 #$Id: blobfiles.py,v 1.4 2002-06-19 03:07:19 richard Exp $
19 ''' 19 '''
20 This module exports file storage for roundup backends. 20 This module exports file storage for roundup backends.
21 Files are stored into a directory hierarchy. 21 Files are stored into a directory hierarchy.
22 ''' 22 '''
23 23
100 ''' 100 '''
101 files_dir = os.path.join(self.dir, 'files') 101 files_dir = os.path.join(self.dir, 'files')
102 return files_in_dir(files_dir) 102 return files_in_dir(files_dir)
103 103
104 def _doStoreFile(self, name, **databases): 104 def _doStoreFile(self, name, **databases):
105 '''Must be implemented by subclass 105 '''Store the file as part of a transaction commit.
106 ''' 106 '''
107 raise NotImplementedError 107 # the file is currently ".tmp" - move it to its real name to commit
108 os.rename(name+".tmp", name)
109 pattern = name.split('/')[-1]
110 self.indexer.add_files(dir=os.path.dirname(name), pattern=pattern)
111 self.indexer.save_index()
108 112
109 # $Log: not supported by cvs2svn $ 113 # $Log: not supported by cvs2svn $
114 # Revision 1.3 2002/02/27 07:33:34 grubert
115 # . add, vim line and cvs log key.
116 #
110 # 117 #
111 # vim: set filetype=python ts=4 sw=4 et si 118 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/