Code

grant web access to admin ;)
[roundup.git] / roundup / indexer.py
index aad5a5a59a21fdc2dc4979e930a7bf179b4d03e0..74bfcafb9e3176ed17e632e75866354b82d18049 100644 (file)
@@ -14,7 +14,7 @@
 #     that promote freedom, but obviously am giving up any rights
 #     to compel such.
 # 
-#$Id: indexer.py,v 1.9 2002-07-14 06:11:16 richard Exp $
+#$Id: indexer.py,v 1.12 2002-07-19 03:36:33 richard Exp $
 '''
 This module provides an indexer class, RoundupIndexer, that stores text
 indices in a roundup instance.  This class makes searching the content of
@@ -49,7 +49,7 @@ class Indexer:
         elif os.path.exists(version):
             version = open(version).read()
             # check the value and reindex if it's not the latest
-            if version != '1':
+            if version.strip() != '1':
                 self.force_reindex()
 
     def force_reindex(self):
@@ -282,7 +282,7 @@ class Indexer:
                 os.remove(self.indexdb + segment)
             except OSError, error:
                 # probably just nonexistent segment index file
-                if error.errno != errno.EEXIST: raise
+                if error.errno != errno.ENOENT: raise
 
         # First write the much simpler filename/fileid dictionaries
         dbfil = {'WORDS':None, 'FILES':self.files, 'FILEIDS':self.fileids}
@@ -312,6 +312,8 @@ class Indexer:
     def purge_entry(self, identifier):
         ''' Remove a file from file index and word index
         '''
+        self.load_index()
+
         if not self.files.has_key(identifier):
             return
 
@@ -333,6 +335,17 @@ class Indexer:
 
 #
 #$Log: not supported by cvs2svn $
+#Revision 1.11  2002/07/18 11:17:30  gmcm
+#Add Number and Boolean types to hyperdb.
+#Add conversion cases to web, mail & admin interfaces.
+#Add storage/serialization cases to back_anydbm & back_metakit.
+#
+#Revision 1.10  2002/07/14 23:17:24  richard
+#oops
+#
+#Revision 1.9  2002/07/14 06:11:16  richard
+#Some TODOs
+#
 #Revision 1.8  2002/07/09 21:53:38  gmcm
 #Optimize Class.find so that the propspec can contain a set of ids to match.
 #This is used by indexer.search so it can do just one find for all the index matches.