[Zope3-checkins] SVN: Zope3/branches/jim-simplifyevents/src/zope/app/presentation/zpt.py Removed unused txt-indexing adapter.

Jim Fulton jim at zope.com
Wed May 26 14:16:23 EDT 2004


Log message for revision 25016:
Removed unused txt-indexing adapter.



-=-
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/presentation/zpt.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/presentation/zpt.py	2004-05-26 18:10:31 UTC (rev 25015)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/presentation/zpt.py	2004-05-26 18:16:23 UTC (rev 25016)
@@ -24,7 +24,6 @@
 
 from zope.app.container.contained import Contained
 from zope.app.registration.interfaces import IRegisterable
-from zope.app.index.interfaces.text import ISearchableText
 from zope.fssync.server.entryadapter import ObjectEntryAdapter, AttrMapping
 from zope.fssync.server.interfaces import IObjectFile
 from zope.app.filerepresentation.interfaces import IReadFile, IWriteFile
@@ -105,31 +104,6 @@
 
         return self.pt_render(namespace)
 
-# Adapter for ISearchableText
-
-tag = re.compile(r"<[^>]+>")
-class SearchableText:
-
-    implements(ISearchableText)
-    __used_for__ = IZPTTemplate
-
-    def __init__(self, page):
-        self.page = page
-
-    def getSearchableText(self):
-        text = self.page.source
-        if isinstance(text, str):
-            text = unicode(self.page.source, 'utf-8')
-        # else:
-        #   text was already Unicode, which happens, but unclear how it
-        #   gets converted to Unicode since the ZPTPage stores UTF-8 as
-        #   an 8-bit string.
-
-        if self.page.contentType.startswith('text/html'):
-            text = tag.sub('', text)
-
-        return [text]
-
 # Adapters for file-system emulation
 
 class ReadFile:




More information about the Zope3-Checkins mailing list