[Zope-Checkins] CVS: Zope2 - Catalog.py:1.70.6.8 ZCatalog.py:1.88.6.16 ZCatalogIndexes.py:1.1.2.13

Andreas Jung andreas@digicool.com
Thu, 24 May 2001 11:33:51 -0400


Update of /cvs-repository/Zope2/lib/python/Products/ZCatalog
In directory yetix:/work/sandboxes/ajung-dropin-registry/lib/python/Products/ZCatalog

Modified Files:
      Tag: ajung-dropin-registry
	Catalog.py ZCatalog.py ZCatalogIndexes.py 
Log Message:
cleanup
- the default vocabulary is now passed directly to the constructor
  of the TextIndex 



--- Updated File Catalog.py in package Zope2 --
--- Catalog.py	2001/05/23 19:23:41	1.70.6.7
+++ Catalog.py	2001/05/24 15:33:39	1.70.6.8
@@ -541,13 +541,16 @@
                 # 
                 if request.has_key(index.id) :
                     if len(request[index.id])>0:
+                        print index.id
                         r=index._apply_index(request)
+                        print r
 
                 if r is not None:
                     r, u = r
                     for name in u: used[name]=1
                     w, rs = weightedIntersection(rs, r)
 
+        print rs
 
                         
         #assert rs==None or hasattr(rs, 'values') or hasattr(rs, 'keys')

--- Updated File ZCatalog.py in package Zope2 --
--- ZCatalog.py	2001/05/24 13:23:24	1.88.6.15
+++ ZCatalog.py	2001/05/24 15:33:40	1.88.6.16
@@ -218,7 +218,7 @@
     manage_objectInformation = DTMLFile('dtml/catalogObjectInformation',
                                         globals())
 
-    Indexes = ZCatalogIndexes()
+   Indexes = ZCatalogIndexes()
 
     threshold=10000
     _v_total=0
@@ -232,19 +232,21 @@
             self=self.__of__(container)
         self.id=id
         self.title=title
+
+        self.vocabulary = None
         
         self.threshold = 10000
         self._v_total = 0
 
         if vocab_id is None:
-            print "we create a new vocabulary"
             v = Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
             self._setObject('Vocabulary', v)
+            self.vocabulary = v
             self.vocab_id = 'Vocabulary'
         else:
-            print "no new vocabulary"
             self.vocab_id = vocab_id
 
+
         self._catalog = Catalog(vocabulary=self.vocab_id)
 
         self.addColumn('id')
@@ -813,7 +815,10 @@
         if base is None:
             raise ValueError, "Index type %s does not support addIndex" % type
 
-        index = base(name, self)
+        if type in ['TextIndex']:
+            index = base(name, self,lexicon=self.vocabulary)
+        else:
+            index = base(name, self)
 
         self._catalog.addIndex(name,index)
 

--- Updated File ZCatalogIndexes.py in package Zope2 --
--- ZCatalogIndexes.py	2001/05/21 21:34:57	1.1.2.12
+++ ZCatalogIndexes.py	2001/05/24 15:33:40	1.1.2.13
@@ -136,6 +136,7 @@
         )
     )
 
+
     #
     # Object Manager methods
     #