[Zope-Checkins] CVS: Packages/OFS - Image.py:1.145.2.11

Stefan H. Holek stefan at epy.co.at
Thu Jan 27 13:47:42 EST 2005


Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv4848/lib/python/OFS

Modified Files:
      Tag: Zope-2_7-branch
	Image.py 
Log Message:
Collector #533: ZMI Find now searches in text Files.


=== Packages/OFS/Image.py 1.145.2.10 => 1.145.2.11 ===
--- Packages/OFS/Image.py:1.145.2.10	Fri Nov  5 10:00:53 2004
+++ Packages/OFS/Image.py	Thu Jan 27 13:47:11 2005
@@ -105,7 +105,7 @@
          ('manage_edit','manage_upload','PUT')),
         ('View',
          ('index_html', 'view_image_or_file', 'get_size',
-          'getContentType', '')),
+          'getContentType', 'PrincipiaSearchSource', '')),
         ('FTP access',
          ('manage_FTPstat','manage_FTPget','manage_FTPlist')),
         ('Delete objects',
@@ -412,6 +412,13 @@
         The default view of the contents of the File or Image.
         """
         raise Redirect, URL1
+
+    def PrincipiaSearchSource(self):
+        """ Allow file objects to be searched.
+        """
+        if self.content_type.startswith('text/'):
+            return str(self.data)
+        return ''
 
     # private
     update_data__roles__=()



More information about the Zope-Checkins mailing list