[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex - PathIndex.py:1.25.6.3

Andreas Jung andreas@digicool.com
Thu, 3 Oct 2002 09:45:21 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex
In directory cvs.zope.org:/tmp/cvs-serv22244

Modified Files:
      Tag: Zope-2_6-branch
	PathIndex.py 
Log Message:
The fix for Collector #593 has been lost for unknown reasons


=== Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 1.25.6.2 => 1.25.6.3 ===
--- Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py:1.25.6.2	Tue Sep 24 07:06:05 2002
+++ Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	Thu Oct  3 09:45:20 2002
@@ -126,8 +126,8 @@
 
         comps = self.splitPath(path,obj)
 
-        if obj.meta_type != 'Folder':
-            comps = comps[:-1]
+#        if obj.meta_type != 'Folder':
+#            comps = comps[:-1]
 
         for i in range(len(comps)):
             self.insertEntry( comps[i],documentId,i)
@@ -146,7 +146,7 @@
         path = self._unindex[documentId]
         comps = path.split('/')
 
-        for level in range(len(comps[1:])-1):
+        for level in range(len(comps[1:])):
             comp = comps[level+1]
 
             self._index[comp][level].remove(documentId)
@@ -209,14 +209,13 @@
 
             results = []
             for i in range(len(comps)):
-
                 comp = comps[i]
 
                 if not self._index.has_key(comp): return IISet()
                 if not self._index[comp].has_key(level+i): return IISet()
 
                 results.append( self._index[comp][level+i] )
-
+            
             res = results[0]
 
             for i in range(1,len(results)):
@@ -228,7 +227,7 @@
 
             results = IISet()
 
-            for level in range(0,self._depth):
+            for level in range(0,self._depth + 1):
 
                 ids = None
                 error = 0
@@ -238,7 +237,7 @@
 
                     try:
                         ids = intersection(ids,self._index[comp][level+cn])
-                    except:
+                    except KeyError:
                         error = 1
 
                 if error==0: