On Wed, 3 Jan 2001, Robin Becker wrote:

> Is there an easy way to make the Find tab case insensitive. It seems
> like a very common need, but I see that FindSupport.py is calling
> string.find which makes it seem as though this is harder than it should
> be.

You can try my very quick patch, attached below.
But beware - it gives much more that you want - it is full regexp search.


--- FindSupport.py      Wed Jul 26 16:11:54 2000
+++ FindSupport_caseIns.py      Wed Jan  3 09:33:34 2001
@@ -92,7 +92,7 @@
 from Globals import HTMLFile
 from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
 from DateTime import DateTime
-from string import find
+from re import search, IGNORECASE
 from AccessControl import getSecurityManager
 
 class FindSupport(ExtensionClass.Base):
@@ -177,7 +177,8 @@
                 and
                 (not obj_searchterm or
                  (hasattr(ob, 'PrincipiaSearchSource') and
-                  find(ob.PrincipiaSearchSource(), obj_searchterm) >= 0
+                  search(obj_searchterm, ob.PrincipiaSearchSource(),
+                   IGNORECASE) != None
                   ))
                 and
                 (not obj_expr or expr_match(ob, obj_expr))
@@ -269,7 +270,8 @@
                 and
                 (not obj_searchterm or
                  (hasattr(ob, 'PrincipiaSearchSource') and
-                  find(ob.PrincipiaSearchSource(), obj_searchterm) >= 0
+                  search(obj_searchterm, ob.PrincipiaSearchSource(),
+                  IGNORECASE) != None
                   ))
                 and
                 (not obj_expr or expr_match(ob, obj_expr))



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

Reply via email to