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
6f647bb8
Commit
6f647bb8
authored
Jul 03, 2009
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed PluginIndexes.TextIndex dependencies (don't know if anybody uses these files)
parent
bbe910a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
src/Products/ZCTextIndex/tests/indexhtml.py
src/Products/ZCTextIndex/tests/indexhtml.py
+11
-10
src/Products/ZCTextIndex/tests/queryhtml.py
src/Products/ZCTextIndex/tests/queryhtml.py
+4
-3
No files found.
src/Products/ZCTextIndex/tests/indexhtml.py
View file @
6f647bb8
...
...
@@ -8,6 +8,7 @@ Will create an index of all files in dir or its subdirectories.
options:
-f data.fs -- the path to the filestorage datafile
"""
# XXX: Products.PluginIndexes.TextIndex no longer exists
from
__future__
import
nested_scopes
import
os
...
...
@@ -47,14 +48,14 @@ class MySplitter:
return
stopdict
.
get
(
w
,
w
)
return
filter
(
None
,
map
(
lookup
,
words
))
def
make_old_index
():
from
Products.PluginIndexes.TextIndex.TextIndex
import
TextIndex
from
Products.PluginIndexes.TextIndex.Lexicon
import
Lexicon
from
Products.ZCTextIndex.StopDict
import
get_stopdict
l
=
Lexicon
(
get_stopdict
())
l
.
SplitterFunc
=
MySplitter
()
return
TextIndex
(
"read"
,
lexicon
=
l
)
#
def make_old_index():
#
from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
#
from Products.PluginIndexes.TextIndex.Lexicon import Lexicon
#
from Products.ZCTextIndex.StopDict import get_stopdict
#
#
l = Lexicon(get_stopdict())
#
l.SplitterFunc = MySplitter()
#
return TextIndex("read", lexicon=l)
def
main
(
db
,
root
,
dir
):
rt
[
"index"
]
=
index
=
INDEX
()
...
...
@@ -135,8 +136,8 @@ if __name__ == "__main__":
PACK_INTERVAL
=
int
(
v
)
if
o
==
'-n'
:
LIMIT
=
int
(
v
)
if
o
==
'-T'
:
INDEX
=
make_old_index
#
if o == '-T':
#
INDEX = make_old_index
if
len
(
args
)
!=
1
:
print
"Expected on argument"
...
...
src/Products/ZCTextIndex/tests/queryhtml.py
View file @
6f647bb8
# XXX: Products.PluginIndexes.TextIndex no longer exists
import
os
from
time
import
clock
...
...
@@ -27,7 +28,7 @@ def path2url(p):
i
+=
len
(
marker
)
return
"http://www.python.org"
+
p
[
i
:]
from
Products.PluginIndexes.TextIndex.TextIndex
import
And
,
Or
#
from Products.PluginIndexes.TextIndex.TextIndex import And, Or
from
Products.ZCTextIndex.tests.indexhtml
import
MySplitter
from
Products.ZCTextIndex.NBest
import
NBest
...
...
@@ -106,8 +107,8 @@ if __name__ == "__main__":
VERBOSE
+=
1
if
o
==
'-f'
:
FSPATH
=
v
if
o
==
'-T'
:
TEXTINDEX
=
1
#
if o == '-T':
#
TEXTINDEX = 1
fs
=
FileStorage
(
FSPATH
,
read_only
=
1
)
db
=
ZODB
.
DB
(
fs
,
cache_size
=
10000
)
...
...
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