[Zope-Checkins] CVS: Zope2 - TextIndex.py:1.1.2.20
Andreas Jung
andreas@digicool.com
Thu, 24 May 2001 10:00:22 -0400
Update of /cvs-repository/Zope2/lib/python/Products/PluginIndexes/TextIndex
In directory yetix:/work/sandboxes/ajung-dropin-registry/lib/python/Products/PluginIndexes/TextIndex
Modified Files:
Tag: ajung-dropin-registry
TextIndex.py
Log Message:
--- Updated File TextIndex.py in package Zope2 --
--- TextIndex.py 2001/05/22 17:45:14 1.1.2.19
+++ TextIndex.py 2001/05/24 14:00:11 1.1.2.20
@@ -96,7 +96,7 @@
import string, re
import operator
-
+import Zope
from Globals import Persistent,DTMLFile
from zLOG import LOG, ERROR
from OFS.SimpleItem import SimpleItem
@@ -177,6 +177,9 @@
'lexicon' is the lexicon object to specify, if None, the
index will use a private lexicon."""
+
+ print "-"*80
+ print "CREATING TEXTINDEX"
self.id = id
self.ignore_ex = ignore_ex
@@ -193,13 +196,16 @@
self.useOperator = 'or'
self.clear()
+ lexicon = "Vocabulary"
if lexicon is None:
## if no lexicon is provided, create a default one
+ print "no lexicon given"
self._lexicon = Lexicon()
else:
# We need to hold a reference to the lexicon, since we can't
# really change lexicons.
+ print "trying to get lexicon "
self._lexicon = self.getLexicon(lexicon)
@@ -212,10 +218,13 @@
in this way, but I don't see too much of a problem with it."""
if type(vocab_id) is not StringType:
+ print "we already have had the lkexicon"
vocab = vocab_id # we already havd the lexicon
return vocab
else:
- vocab = getattr(self, vocab_id)
+ print "calling getattr"
+ print self.aq_parent
+ vocab = getattr(self.aq_parent, vocab_id)
return vocab.lexicon
def __nonzero__(self):
@@ -687,11 +696,6 @@
return len(self._index)
- def manage_vocabulary(self):
- """ """
- return ""
-
-
def manage_setPreferences(self,splitter,text_operator,
REQUEST=None,RESPONSE=None,URL2=None):
""" preferences of TextIndex """
@@ -702,9 +706,9 @@
if RESPONSE:
RESPONSE.redirect(URL2 + '/manage_main?manage_tabs_message=Preferences%20saved')
-
- manage_workspace = DTMLFile("dtml/manageTextIndex",globals())
+ manage_workspace = DTMLFile("dtml/manageTextIndex",globals())
+ manage_vocabulary = DTMLFile("dtml/manageVocabulary",globals())
def parse(s):
"""Parse parentheses and quotes"""