[Zope-Checkins] SVN: Zope/branches/2.12/ - added 'indexSize' to IPluggableIndex

Yvo Schubbe y.2009 at wcm-solutions.de
Sat Jul 4 06:46:19 EDT 2009


Log message for revision 101505:
  - added 'indexSize' to IPluggableIndex

Changed:
  U   Zope/branches/2.12/doc/CHANGES.rst
  U   Zope/branches/2.12/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
  U   Zope/branches/2.12/src/Products/PluginIndexes/PathIndex/PathIndex.py
  U   Zope/branches/2.12/src/Products/PluginIndexes/TopicIndex/TopicIndex.py
  U   Zope/branches/2.12/src/Products/PluginIndexes/common/UnIndex.py
  U   Zope/branches/2.12/src/Products/PluginIndexes/interfaces.py

-=-
Modified: Zope/branches/2.12/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.12/doc/CHANGES.rst	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/doc/CHANGES.rst	2009-07-04 10:46:19 UTC (rev 101505)
@@ -28,6 +28,8 @@
 Bugs Fixed
 ++++++++++
 
+- PluginIndexes: Added 'indexSize' to IPluggableIndex.
+
 - HelpSys: ProductHelp no longer depends on PluginIndexes initialization.
 
 - App.Product: ProductHelp was broken since Zope 2.12.0a1.

Modified: Zope/branches/2.12/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
===================================================================
--- Zope/branches/2.12/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py	2009-07-04 10:46:19 UTC (rev 101505)
@@ -300,18 +300,6 @@
         return result, ( self._since_field, self._until_field )
 
     #
-    #   ZCatalog needs this, although it isn't (yet) part of the interface.
-    #
-    security.declareProtected(view , 'numObjects')
-    def numObjects( self ):
-        """ """
-        return len( self._unindex )
-
-    def indexSize(self):
-        """ """
-        return len(self)
-
-    #
     #   Helper functions.
     #
     def _insertForwardIndexEntry( self, since, until, documentId ):

Modified: Zope/branches/2.12/src/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/branches/2.12/src/Products/PluginIndexes/PathIndex/PathIndex.py	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/src/Products/PluginIndexes/PathIndex/PathIndex.py	2009-07-04 10:46:19 UTC (rev 101505)
@@ -193,11 +193,11 @@
         return results
 
     def numObjects(self):
-        """ return the number distinct values """
+        """Return the number of indexed objects."""
         return len(self._unindex)
 
     def indexSize(self):
-        """ return the number of indexed objects"""
+        """Return the size of the index in terms of distinct values."""
         return len(self)
 
     def __len__(self):

Modified: Zope/branches/2.12/src/Products/PluginIndexes/TopicIndex/TopicIndex.py
===================================================================
--- Zope/branches/2.12/src/Products/PluginIndexes/TopicIndex/TopicIndex.py	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/src/Products/PluginIndexes/TopicIndex/TopicIndex.py	2009-07-04 10:46:19 UTC (rev 101505)
@@ -85,8 +85,13 @@
         return 1
 
     def numObjects(self):
+        """Return the number of indexed objects."""
         return "n/a"
 
+    def indexSize(self):
+        """Return the size of the index in terms of distinct values."""
+        return "n/a"
+
     def search(self,filter_id):
         if self.filteredSets.has_key(filter_id):
             return self.filteredSets[filter_id].getIds()

Modified: Zope/branches/2.12/src/Products/PluginIndexes/common/UnIndex.py
===================================================================
--- Zope/branches/2.12/src/Products/PluginIndexes/common/UnIndex.py	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/src/Products/PluginIndexes/common/UnIndex.py	2009-07-04 10:46:19 UTC (rev 101505)
@@ -277,11 +277,11 @@
         return datum
 
     def numObjects(self):
-        """ return number of indexed objects """
+        """Return the number of indexed objects."""
         return len(self._unindex)
 
     def indexSize(self):
-        """ return of distinct values indexed"""
+        """Return the size of the index in terms of distinct values."""
         return len(self)
 
     def unindex_object(self, documentId):

Modified: Zope/branches/2.12/src/Products/PluginIndexes/interfaces.py
===================================================================
--- Zope/branches/2.12/src/Products/PluginIndexes/interfaces.py	2009-07-04 10:42:18 UTC (rev 101504)
+++ Zope/branches/2.12/src/Products/PluginIndexes/interfaces.py	2009-07-04 10:46:19 UTC (rev 101505)
@@ -68,11 +68,10 @@
         """
 
     def numObjects():
-        """Return the number of indexed objects"""
+        """Return the number of indexed objects."""
 
-# XXX: not implemented by TextIndex and TopicIndex
-#    def indexSize():
-#        """Return the size of the index in terms of distinct values"""
+    def indexSize():
+        """Return the size of the index in terms of distinct values."""
 
     def clear():
         """Empty the index"""



More information about the Zope-Checkins mailing list