Commit 6f647bb8 authored by 's avatar

- removed PluginIndexes.TextIndex dependencies (don't know if anybody uses these files)

parent bbe910a0
......@@ -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"
......
# 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)
......
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