[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/intid/ Merged from /z3/jim-index-restructure-2004-12 branch:

Jim Fulton jim at zope.com
Thu Dec 9 15:53:48 EST 2004


Log message for revision 28609:
  Merged from /z3/jim-index-restructure-2004-12 branch:
  
  r28596 | jim | 2004-12-09 11:40:03 -0500 (Thu, 09 Dec 2004) | 2 lines
  
  Added an iteration protocol.
  
  M    src/zope/app/zptpage/textindex/zptpage.py
  M    src/zope/app/zptpage/textindex/configure.zcml
  M    src/zope/app/zptpage/textindex/tests.py
  D    src/zope/app/catalog/ftests.py
  M    src/zope/app/catalog/catalog.py
  A    src/zope/app/catalog/browser/ftests.py
  M    src/zope/app/catalog/browser/configure.zcml
  A    src/zope/app/catalog/browser/README.txt
  M    src/zope/app/catalog/configure.zcml
  M    src/zope/app/catalog/tests.py
  M    src/zope/app/catalog/interfaces.py
  M    src/zope/app/catalog/text.py
  R    src/zope/app/catalog/README.txt
  D    src/zope/app/catalog/keyword.py
  A    src/zope/index/nbest.py
  D    src/zope/index/interfaces
  D    src/zope/index/interfaces/nbest.py
  D    src/zope/index/interfaces/searchabletext.py
  D    src/zope/index/interfaces/__init__.py
  D    src/zope/index/interfaces/pipelineelement.py
  D    src/zope/index/interfaces/queryparsetree.py
  D    src/zope/index/interfaces/lexicon.py
  D    src/zope/index/interfaces/queryparser.py
  D    src/zope/index/interfaces/splitter.py
  D    src/zope/index/interfaces/pipelineelementfactory.py
  D    src/zope/index/field/tests
  D    src/zope/index/field/tests/test_fieldindex.py
  D    src/zope/index/field/tests/__init__.py
  A    src/zope/index/field/tests.py
  A    src/zope/index/field/README.txt
  M    src/zope/index/field/index.py
  M    src/zope/index/text/parsetree.py
  M    src/zope/index/text/okapiindex.py
  M    src/zope/index/text/htmlsplitter.py
  D    src/zope/index/text/pipelinefactory.py
  M    src/zope/index/text/__init__.py
  M    src/zope/index/text/lexicon.py
  M    src/zope/index/text/baseindex.py
  A    src/zope/index/text/textindex.txt
  M    src/zope/index/text/cosineindex.py
  M    src/zope/index/text/tests/queryhtml.py
  D    src/zope/index/text/tests/test_nbest.py
  M    src/zope/index/text/tests/test_queryengine.py
  M    src/zope/index/text/tests/test_setops.py
  M    src/zope/index/text/tests/test_textindexwrapper.py
  D    src/zope/index/text/tests/test_pipelinefactory.py
  M    src/zope/index/text/tests/test_queryparser.py
  D    src/zope/index/text/nbest.py
  A    src/zope/index/text/textindex.py
  M    src/zope/index/text/setops.py
  D    src/zope/index/text/textindexwrapper.py
  M    src/zope/index/text/queryparser.py
  A    src/zope/index/text/interfaces.py
  M    src/zope/index/keyword/tests.py
  A    src/zope/index/keyword/interfaces.py
  M    src/zope/index/keyword/index.py
  A    src/zope/index/tests.py
  A    src/zope/index/interfaces.py
  A    src/zope/index/topic/interfaces.py
  M    src/zope/index/topic/filter.py
  M    src/zope/index/topic/index.py
  
  Merged from /z3/jim-index-restructure-2004-12 branch:
  
  r28574 | jim | 2004-12-06 10:04:19 -0500 (Mon, 06 Dec 2004) | 11 lines
  
  Updated IInjection to emphasize indexing of values (for documents),
    rather than documents.
  
  Added IIndexSearch, which provides a search that returns integer sets
    or mappings.
  
  Updated field indexes to provide IIndexSearch as their only search
    method.
  
  Replaced the field-index tests with a doctest.
  
  ------------------------------------------------------------------------
    r28576 | jim | 2004-12-06 16:52:05 -0500 (Mon, 06 Dec 2004) | 2 lines
  
  Renamed apply_index to apply.
  
  ------------------------------------------------------------------------
    r28577 | jim | 2004-12-07 13:15:57 -0500 (Tue, 07 Dec 2004) | 10 lines
    r28578 | jim | 2004-12-07 13:17:30 -0500 (Tue, 07 Dec 2004) | 4 lines
  
  - Removed the unused pipeline-element framework. WHUI
  
  - Moved the nbest code out of text, as it should generally be
      used by applications that call indexes, not by the indexes
      themselves.
  
  - Moved the text-indexing interfaces into text/interfaces.py.
  
  - Converted the interfaces package into a module
  
  ------------------------------------------------------------------------
    r28579 | jim | 2004-12-07 13:23:58 -0500 (Tue, 07 Dec 2004) | 2 lines
  
  Moved IExtendedQuerying to text interfaces.py
  
  ------------------------------------------------------------------------
    r28580 | jim | 2004-12-07 17:36:18 -0500 (Tue, 07 Dec 2004) | 4 lines
  
  Refactored the text index to implement IIndexSearch, rather than
    IQuerying. Also renamed TextIndexWrapper to TextIndex. (Wrapper was
    confusing.)
  
  ------------------------------------------------------------------------
    r28581 | jim | 2004-12-07 17:54:00 -0500 (Tue, 07 Dec 2004) | 2 lines
  
  Moved the topic- and keyword-index interfaces into their own interface modules
    ------------------------------------------------------------------------
    r28591 | jim | 2004-12-08 18:14:23 -0500 (Wed, 08 Dec 2004) | 2 lines
  
  Updated text indexes to use IF {integer->float} BTrees rather than II BTrees
  
  ------------------------------------------------------------------------
    r28595 | jim | 2004-12-08 18:35:13 -0500 (Wed, 08 Dec 2004) | 4 lines
  
  Updated catalog code to reflect indexing api changes.
  
  Also removed keyword indexes, which were incomplete.
  
  ------------------------------------------------------------------------
    r28602 | jim | 2004-12-09 14:41:55 -0500 (Thu, 09 Dec 2004) | 5 lines
  
  Changed indexes using sets to use IFSets rather than IISets.
  
  This is needed ebcause we have switched to using floating-point
    scores.
  
  ------------------------------------------------------------------------
    r28604 | jim | 2004-12-09 15:10:58 -0500 (Thu, 09 Dec 2004) | 4 lines
    r28607 | jim | 2004-12-09 15:28:41 -0500 (Thu, 09 Dec 2004) | 2 lines
  
  Moved the functional tests to the browser package and created a new
    README.txt aimed at Python programmers.  This documents the new
    IIndexedSearch API.
  

Changed:
  U   Zope3/trunk/src/zope/app/intid/__init__.py
  U   Zope3/trunk/src/zope/app/intid/interfaces.py
  U   Zope3/trunk/src/zope/app/intid/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/intid/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/__init__.py	2004-12-09 20:53:41 UTC (rev 28608)
+++ Zope3/trunk/src/zope/app/intid/__init__.py	2004-12-09 20:53:47 UTC (rev 28609)
@@ -59,6 +59,9 @@
     def items(self):
         return list(self.refs.items())
 
+    def __iter__(self):
+        return self.refs.iterkeys()
+
     def getObject(self, id):
         return self.refs[id]()
 

Modified: Zope3/trunk/src/zope/app/intid/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/interfaces.py	2004-12-09 20:53:41 UTC (rev 28608)
+++ Zope3/trunk/src/zope/app/intid/interfaces.py	2004-12-09 20:53:47 UTC (rev 28609)
@@ -27,6 +27,10 @@
         Return the default if the object isn't registered
         """
 
+    def __iter__():
+        """Return an iteration on the ids"""
+        
+
 class IIntIdsSet(Interface):
 
     def register(ob):

Modified: Zope3/trunk/src/zope/app/intid/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/tests.py	2004-12-09 20:53:41 UTC (rev 28608)
+++ Zope3/trunk/src/zope/app/intid/tests.py	2004-12-09 20:53:47 UTC (rev 28609)
@@ -98,11 +98,13 @@
 
         self.assertEquals(len(u), 0)
         self.assertEquals(u.items(), [])
+        self.assertEquals(list(u), [])
 
         uid = u.register(obj)
         ref = KeyReferenceToPersistent(obj)
         self.assertEquals(len(u), 1)
         self.assertEquals(u.items(), [(uid, ref)])
+        self.assertEquals(list(u), [uid])
 
         obj2 = P()
         obj2.__parent__ = obj
@@ -115,6 +117,11 @@
         result.sort()
         expected.sort()
         self.assertEquals(result, expected)
+        result = list(u)
+        expected = [uid, uid2]
+        result.sort()
+        expected.sort()
+        self.assertEquals(result, expected)
 
         u.unregister(obj)
         u.unregister(obj2)



More information about the Zope3-Checkins mailing list