I'm updating a site that is currently using Python 1.5.2 and Zope 
2.3.something to use Python 2.1 and Zope 2.4.from_cvs.

I've had a problem: most products won't initialize. They fail on an 
AttributeError in SearchIndex/UnTextIndex.py related to setting up the 
help system.

This ugly patch fixes it. There must be a better way!



*** /lib/python/SearchIndex/UnTextIndex.py.original
--- /lib/python/SearchIndex/UnTextIndex.py.new
***************
*** 327,333 ****
               return 0

           lexicon = self.getLexicon(self._lexicon)
!         splitter=lexicon.Splitter

           wordScores = OIBTree()
           last = None
--- 327,337 ----
               return 0

           lexicon = self.getLexicon(self._lexicon)
!
!         try:
!             splitter=lexicon.Splitter
!         except AttributeError:
!             splitter=lexicon.lexicon.Splitter

           wordScores = OIBTree()
           last = None
***************
*** 343,349 ****

           # Convert scores to use wids:
           widScores=IIBucket()
!         getWid=lexicon.getWordId
           for word, score in wordScores.items():
               widScores[getWid(word)]=score

--- 347,356 ----

           # Convert scores to use wids:
           widScores=IIBucket()
!         try:
!             getWid=lexicon.getWordId
!         except AttributeError:
!             getWid=lexicon.lexicon.getWordId
           for word, score in wordScores.items():
               widScores[getWid(word)]=score

--
Steve Alexander
Software Engineer
Cat-Box limited


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to