Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c58f2419
Commit
c58f2419
authored
Nov 29, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace string modules calls by string methods
parent
79a1de6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
lib/python/Products/PluginIndexes/TextIndex/GlobbingLexicon.py
...ython/Products/PluginIndexes/TextIndex/GlobbingLexicon.py
+2
-2
lib/python/Products/PluginIndexes/TextIndex/TextIndex.py
lib/python/Products/PluginIndexes/TextIndex/TextIndex.py
+8
-8
No files found.
lib/python/Products/PluginIndexes/TextIndex/GlobbingLexicon.py
View file @
c58f2419
...
...
@@ -252,10 +252,10 @@ class GlobbingLexicon(Lexicon):
r'()&|!@#$%^{}\
<>.
')
# 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
...
...
lib/python/Products/PluginIndexes/TextIndex/TextIndex.py
View file @
c58f2419
...
...
@@ -15,10 +15,10 @@
"""
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
import
string
,
re
import
re
import
operator
,
warnings
from
Globals
import
Persistent
,
DTMLFile
from
zLOG
import
LOG
,
ERROR
...
...
@@ -480,7 +480,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
r
=
None
for
key
in
record
.
keys
:
key
=
string
.
strip
(
key
)
key
=
key
.
strip
(
)
if
not
key
:
continue
...
...
@@ -662,7 +662,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
def
parse
(
s
):
"""Parse parentheses and quotes"""
l
=
[]
tmp
=
s
tring
.
lower
(
s
)
tmp
=
s
.
lower
(
)
p
=
parens
(
tmp
)
while
p
is
not
None
:
...
...
@@ -727,9 +727,9 @@ def parens(s, parens_re=re.compile('[()]').search):
def
quotes
(
s
):
split
=
string
.
split
if
'"'
not
in
s
:
return
s
plit
(
s
)
return
s
.
split
(
)
# split up quoted regions
splitted
=
re
.
split
(
'
\
s*
\
"
\
s*
'
, s)
...
...
@@ -738,7 +738,7 @@ def quotes(s):
for i in range(1,len(splitted),2):
# split the quoted region into words
words = splitted[i] = split
(splitted[i]
)
words = splitted[i] = split
ted[i].split(
)
# put the Proxmity operator in between quoted words
j = len(words) - 1
...
...
@@ -749,7 +749,7 @@ def quotes(s):
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] = split
ted[i].split(
)
i = i - 2
return filter(None, splitted)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment