[Zope-Checkins] CVS: Zope2 - Catalog.py:1.67.8.1
chrism@serenade.digicool.com
chrism@serenade.digicool.com
Thu, 19 Apr 2001 13:20:43 -0400
Update of /cvs-repository/Zope2/lib/python/Products/ZCatalog
In directory serenade.digicool.com:/home/chrism/sandboxes/RegexExtermination/lib/python/Products/ZCatalog
Modified Files:
Tag: ajung-2_4-ts_regex-exterminiation-branch
Catalog.py
Log Message:
Removed dependencies on regex module (untested due to other breakages in branch!)
--- Updated File Catalog.py in package Zope2 --
--- Catalog.py 2001/03/23 20:52:39 1.67
+++ Catalog.py 2001/04/19 17:20:43 1.67.8.1
@@ -86,9 +86,8 @@
from Persistence import Persistent
import Acquisition
import ExtensionClass
-from SearchIndex import UnIndex, UnTextIndex, UnKeywordIndex, Query
+from SearchIndex import UnIndex, UnTextIndex, UnKeywordIndex
from SearchIndex.Lexicon import Lexicon
-import regex, pdb
from MultiMapping import MultiMapping
from string import lower
import Record
@@ -106,19 +105,6 @@
import time
-def orify(seq,
- query_map={
- type(regex.compile('')): Query.Regex,
- type(''): Query.String,
- }):
- subqueries=[]
- for q in seq:
- try: q=query_map[type(q)](q)
- except KeyError: q=Query.Cmp(q)
- subqueries.append(q)
- return apply(Query.Or,tuple(subqueries))
-
-
class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
""" An Object Catalog
@@ -606,14 +592,8 @@
LazyMap(self.__getitem__,[did])))
return used
-
- def searchResults(self, REQUEST=None, used=None,
- query_map={
- type(regex.compile('')): Query.Regex,
- type([]): orify,
- type(''): Query.String,
- }, **kw):
+ def searchResults(self, REQUEST=None, used=None, **kw):
# Get search arguments:
if REQUEST is None and not kw:
try: REQUEST=self.REQUEST