[Zope-Checkins] CVS: Zope2 - TextIndex.py:1.4

andreas@serenade.digicool.com andreas@serenade.digicool.com
Thu, 31 May 2001 08:23:24 -0400


Update of /cvs-repository/Zope2/lib/python/Products/PluginIndexes/TextIndex
In directory serenade:/tmp/cvs-serv24400/PluginIndexes/TextIndex

Modified Files:
	TextIndex.py 
Log Message:
- Fix for passing additional parameters 
- minor code cleanup for handling wrong index names



--- Updated File TextIndex.py in package Zope2 --
--- TextIndex.py	2001/05/30 19:29:18	1.3
+++ TextIndex.py	2001/05/31 12:22:53	1.4
@@ -150,7 +150,7 @@
          'help': ('TextIndex','TextIndex_Settings.stx')},
     )
  
-    def __init__(self, id, ignore_ex=None, call_methods=None, lexicon=None):
+    def __init__(self, id, ignore_ex=None, call_methods=None, lexicon=None,extra=None):
         """Create an index
 
         The arguments are:
@@ -168,9 +168,9 @@
           index will use a private lexicon."""
 
         
-        self.id = id
-        self.ignore_ex = ignore_ex
-        self.call_methods = call_methods
+        self.id             = id
+        self.ignore_ex      = ignore_ex
+        self.call_methods   = call_methods
 
 
         # Default text index operator (should be visible to ZMI)
@@ -180,7 +180,9 @@
 
         self.clear()
 
-        self.vocabulary_id = "Vocabulary"
+        if extra:   self.vocabulary_id = extra.vocabulary
+        else:       self.vocabulary_id = "Vocabulary"
+
         self._lexicon = None
 
         if lexicon is not None:
@@ -795,7 +797,7 @@
 
 manage_addTextIndexForm = DTMLFile('dtml/addTextIndex', globals())
 
-def manage_addTextIndex(self, id, REQUEST=None, RESPONSE=None, URL3=None):
+def manage_addTextIndex(self, id, extra=None, REQUEST=None, RESPONSE=None, URL3=None):
     """Add a text index"""
-    return self.manage_addIndex(id, 'TextIndex', REQUEST, RESPONSE, URL3)
+    return self.manage_addIndex(id, 'TextIndex', extra, REQUEST, RESPONSE, URL3)