Mercurial > p > roundup > code
diff roundup/backends/blobfiles.py @ 818:254b8d112eec
cleaned up the indexer code:
- it splits more words out (much simpler, faster splitter)
- removed code we'll never use (roundup.roundup_indexer has the full
implementation, and replaces roundup.indexer)
- only index text/plain and rfc822/message (ideas for other text formats to
index are welcome)
- added simple unit test for indexer. Needs more tests for regression.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 08 Jul 2002 06:58:15 +0000 |
| parents | fb2ce2b8b2ef |
| children | 0779ea9f1f18 |
line wrap: on
line diff
--- a/roundup/backends/blobfiles.py Mon Jul 08 06:53:57 2002 +0000 +++ b/roundup/backends/blobfiles.py Mon Jul 08 06:58:15 2002 +0000 @@ -15,13 +15,13 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: blobfiles.py,v 1.4 2002-06-19 03:07:19 richard Exp $ +#$Id: blobfiles.py,v 1.5 2002-07-08 06:58:15 richard Exp $ ''' This module exports file storage for roundup backends. Files are stored into a directory hierarchy. ''' -import os, os.path +import os def files_in_dir(dir): if not os.path.exists(dir): @@ -106,11 +106,13 @@ ''' # 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.add_file(name) self.indexer.save_index() # $Log: not supported by cvs2svn $ +# Revision 1.4 2002/06/19 03:07:19 richard +# Moved the file storage commit into blobfiles where it belongs. +# # Revision 1.3 2002/02/27 07:33:34 grubert # . add, vim line and cvs log key. #
