Commit c58f2419 authored by Andreas Jung's avatar Andreas Jung

replace string modules calls by string methods

parent 79a1de6a
...@@ -252,10 +252,10 @@ class GlobbingLexicon(Lexicon): ...@@ -252,10 +252,10 @@ class GlobbingLexicon(Lexicon):
r'()&|!@#$%^{}\<>.') r'()&|!@#$%^{}\<>.')
# First, deal with multi-character globbing # First, deal with multi-character globbing
result = string.replace(result, '*', '.*') result = result.replace( '*', '.*')
# Next, we need to deal with single-character globbing # Next, we need to deal with single-character globbing
result = string.replace(result, '?', '.') result = result.replace( '?', '.')
return "%s$" % result return "%s$" % result
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
""" """
__version__ = '$Revision: 1.23 $'[11:-2] __version__ = '$Revision: 1.24 $'[11:-2]
import string, re import re
import operator,warnings import operator,warnings
from Globals import Persistent,DTMLFile from Globals import Persistent,DTMLFile
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
...@@ -480,7 +480,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -480,7 +480,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
r = None r = None
for key in record.keys: for key in record.keys:
key = string.strip(key) key = key.strip()
if not key: if not key:
continue continue
...@@ -662,7 +662,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -662,7 +662,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
def parse(s): def parse(s):
"""Parse parentheses and quotes""" """Parse parentheses and quotes"""
l = [] l = []
tmp = string.lower(s) tmp = s.lower()
p = parens(tmp) p = parens(tmp)
while p is not None: while p is not None:
...@@ -727,9 +727,9 @@ def parens(s, parens_re=re.compile('[()]').search): ...@@ -727,9 +727,9 @@ def parens(s, parens_re=re.compile('[()]').search):
def quotes(s): def quotes(s):
split=string.split
if '"' not in s: if '"' not in s:
return split(s) return s.split()
# split up quoted regions # split up quoted regions
splitted = re.split('\s*\"\s*', s) splitted = re.split('\s*\"\s*', s)
...@@ -738,7 +738,7 @@ def quotes(s): ...@@ -738,7 +738,7 @@ def quotes(s):
for i in range(1,len(splitted),2): for i in range(1,len(splitted),2):
# split the quoted region into words # 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 # put the Proxmity operator in between quoted words
j = len(words) - 1 j = len(words) - 1
...@@ -749,7 +749,7 @@ def quotes(s): ...@@ -749,7 +749,7 @@ def quotes(s):
i = len(splitted) - 1 i = len(splitted) - 1
while i >= 0: while i >= 0:
# split the non-quoted region into words # split the non-quoted region into words
splitted[i:i+1] = split(splitted[i]) splitted[i:i+1] = splitted[i].split()
i = i - 2 i = i - 2
return filter(None, splitted) return filter(None, splitted)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment