[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - GlobbingLexicon.py:1.10 TextIndex.py:1.24

Andreas Jung andreas@zope.com
Thu, 29 Nov 2001 14:44:15 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv9313/TextIndex

Modified Files:
	GlobbingLexicon.py TextIndex.py 
Log Message:
replace string modules calls by string methods


=== Zope/lib/python/Products/PluginIndexes/TextIndex/GlobbingLexicon.py 1.9 => 1.10 ===
         
         # First, deal with multi-character globbing
-        result = string.replace(result, '*', '.*')
+        result = result.replace( '*', '.*')
 
         # Next, we need to deal with single-character globbing
-        result = string.replace(result, '?', '.')
+        result = result.replace( '?', '.')
 
         return "%s$" % result 
 


=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.23 => 1.24 ===
 
 
-import string, re
+import  re
 import operator,warnings
 from Globals import Persistent,DTMLFile
 from zLOG import LOG, ERROR
@@ -480,7 +480,7 @@
         r = None
 
         for key in record.keys:
-            key = string.strip(key)
+            key = key.strip()
             if not key:
                 continue
 
@@ -662,7 +662,7 @@
 def parse(s):
     """Parse parentheses and quotes"""
     l = []
-    tmp = string.lower(s)
+    tmp = s.lower()
 
     p = parens(tmp)
     while p is not None:
@@ -727,9 +727,9 @@
 
 
 def quotes(s):
-    split=string.split
+
     if '"' not in s:
-        return split(s)
+        return s.split()
     
     # split up quoted regions
     splitted = re.split('\s*\"\s*', s)
@@ -738,7 +738,7 @@
     
     for i in range(1,len(splitted),2):
         # split the quoted region into words
-        words = splitted[i] = split(splitted[i])
+        words = splitted[i] = splitted[i].split()
         
         # put the Proxmity operator in between quoted words
         j = len(words) - 1
@@ -749,7 +749,7 @@
     i = len(splitted) - 1
     while i >= 0:
         # split the non-quoted region into words
-        splitted[i:i+1] = split(splitted[i])
+        splitted[i:i+1] = splitted[i].split()
         i = i - 2
 
     return filter(None, splitted)