[Zope3-checkins] CVS: Zope3/src/zope/textindex - baseindex.py:1.4 cosineindex.py:1.3 htmlsplitter.py:1.3 lexicon.py:1.3 nbest.py:1.3 okapiindex.py:1.3 parsetree.py:1.3 pipelinefactory.py:1.3 queryparser.py:1.3 textindexwrapper.py:1.3

Steve Alexander steve@cat-box.net
Tue, 3 Jun 2003 11:33:08 -0400


Update of /cvs-repository/Zope3/src/zope/textindex
In directory cvs.zope.org:/tmp/cvs-serv7333/src/zope/textindex

Modified Files:
	baseindex.py cosineindex.py htmlsplitter.py lexicon.py 
	nbest.py okapiindex.py parsetree.py pipelinefactory.py 
	queryparser.py textindexwrapper.py 
Log Message:
Now uses new-style implements()


=== Zope3/src/zope/textindex/baseindex.py 1.3 => 1.4 ===
--- Zope3/src/zope/textindex/baseindex.py:1.3	Thu May  1 15:35:51 2003
+++ Zope3/src/zope/textindex/baseindex.py	Tue Jun  3 11:32:37 2003
@@ -18,6 +18,7 @@
 import math
 
 from persistence import Persistent
+from zope.interface import implements
 
 from zodb.btrees.IOBTree import IOBTree
 from zodb.btrees.IIBTree import IIBTree, IITreeSet
@@ -51,8 +52,7 @@
     return IITreeSet(L).keys()
 
 class BaseIndex(Persistent):
-
-    __implements__ = IIndex
+    implements(IIndex)
 
     def __init__(self, lexicon):
         self._lexicon = lexicon


=== Zope3/src/zope/textindex/cosineindex.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/cosineindex.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/cosineindex.py	Tue Jun  3 11:32:37 2003
@@ -17,6 +17,7 @@
 import math
 
 from zodb.btrees.IIBTree import IIBucket
+from zope.interface import implements
 
 from zope.textindex.iindex import IIndex
 from zope.textindex.baseindex import BaseIndex, \
@@ -25,7 +26,7 @@
 
 class CosineIndex(BaseIndex):
 
-    __implements__ = IIndex
+    implements(IIndex)
 
     def __init__(self, lexicon):
         BaseIndex.__init__(self, lexicon)


=== Zope3/src/zope/textindex/htmlsplitter.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/htmlsplitter.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/htmlsplitter.py	Tue Jun  3 11:32:37 2003
@@ -14,13 +14,15 @@
 
 import re
 
+from zope.interface import implements
+
 from zope.textindex.isplitter import ISplitter
 from zope.textindex.pipelinefactory import element_factory
 
 
 class HTMLWordSplitter:
 
-    __implements__ = ISplitter
+    implements(ISplitter)
 
     def process(self, text, wordpat=r"(?L)\w+"):
         splat = []


=== Zope3/src/zope/textindex/lexicon.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/lexicon.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/lexicon.py	Tue Jun  3 11:32:37 2003
@@ -14,6 +14,8 @@
 
 import re
 
+from zope.interface import implements
+
 import zodb
 
 from zodb.btrees.IOBTree import IOBTree
@@ -29,7 +31,7 @@
 
 class Lexicon(Persistent):
 
-    __implements__ = ILexicon
+    implements(ILexicon)
 
     def __init__(self, *pipeline):
         self._wids = OIBTree()  # word -> wid


=== Zope3/src/zope/textindex/nbest.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/nbest.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/nbest.py	Tue Jun  3 11:32:37 2003
@@ -21,9 +21,10 @@
 from bisect import bisect_left as bisect
 
 from zope.textindex.inbest import INBest
+from zope.interface import implements
 
 class NBest:
-    __implements__ = INBest
+    implements(INBest)
 
     def __init__(self, N):
         "Build an NBest object to remember the N best-scoring objects."


=== Zope3/src/zope/textindex/okapiindex.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/okapiindex.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/okapiindex.py	Tue Jun  3 11:32:37 2003
@@ -22,10 +22,11 @@
 from zope.textindex.iindex import IIndex
 from zope.textindex.baseindex import \
      BaseIndex, inverse_doc_frequency, scaled_int
+from zope.interface import implements
 
 class OkapiIndex(BaseIndex):
 
-    __implements__ = IIndex
+    implements(IIndex)
 
     # BM25 free parameters.
     K1 = 1.2


=== Zope3/src/zope/textindex/parsetree.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/parsetree.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/parsetree.py	Tue Jun  3 11:32:37 2003
@@ -20,6 +20,8 @@
 from zope.textindex.setops import mass_weightedIntersection, \
                                   mass_weightedUnion
 
+from zope.interface import implements
+
 class QueryError(Exception):
     pass
 
@@ -28,7 +30,7 @@
 
 class ParseTreeNode:
 
-    __implements__ = IQueryParseTree
+    implements(IQueryParseTree)
 
     _nodeType = None
 


=== Zope3/src/zope/textindex/pipelinefactory.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/pipelinefactory.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/pipelinefactory.py	Tue Jun  3 11:32:37 2003
@@ -12,12 +12,12 @@
 #
 ##############################################################################
 
-from zope.textindex.ipipelineelementfactory \
-     import IPipelineElementFactory
+from zope.textindex.ipipelineelementfactory import IPipelineElementFactory
+from zope.interface import implements
 
 class PipelineElementFactory:
 
-    __implements__ = IPipelineElementFactory
+    implements(IPipelineElementFactory)
 
     def __init__(self):
         self._groups = {}


=== Zope3/src/zope/textindex/queryparser.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/queryparser.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/queryparser.py	Tue Jun  3 11:32:37 2003
@@ -56,6 +56,7 @@
 """
 
 import re
+from zope.interface import implements
 
 from zope.textindex.iqueryparser import IQueryParser
 from zope.textindex import parsetree
@@ -95,7 +96,7 @@
 
 class QueryParser:
 
-    __implements__ = IQueryParser
+    implements(IQueryParser)
 
     # This class is not thread-safe;
     # each thread should have its own instance


=== Zope3/src/zope/textindex/textindexwrapper.py 1.2 => 1.3 ===
--- Zope3/src/zope/textindex/textindexwrapper.py:1.2	Wed Dec 25 09:15:34 2002
+++ Zope3/src/zope/textindex/textindexwrapper.py	Tue Jun  3 11:32:37 2003
@@ -19,6 +19,7 @@
 """
 
 from persistence import Persistent
+from zope.interface import implements
 
 from zope.textindex.okapiindex import OkapiIndex
 from zope.textindex.lexicon import Lexicon
@@ -31,7 +32,7 @@
 
 class TextIndexWrapper(Persistent):
 
-    __implements__ = (IInjection, IQuerying, IStatistics)
+    implements(IInjection, IQuerying, IStatistics)
 
     def __init__(self, lexicon=None, index=None):
         """Provisional constructor.