[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex - FilteredSet.py:1.4 TopicIndex.py:1.9 __init__.py:1.3
Martijn Pieters
mj@zope.com
Wed, 14 Aug 2002 18:20:05 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex
In directory cvs.zope.org:/tmp/cvs-serv24540/TopicIndex
Modified Files:
FilteredSet.py TopicIndex.py __init__.py
Log Message:
Clean up indentation and trailing whitespace.
=== Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py:1.3 Mon Mar 11 09:53:05 2002
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py Wed Aug 14 18:19:34 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
__version__ = '$Id$'
@@ -27,7 +27,7 @@
self.expr = expr
self.clear()
-
+
def clear(self):
self.ids = IISet()
@@ -47,10 +47,10 @@
def getType(self): return self.meta_type
def setExpression(self, expr): self.expr = expr
-
+
def __repr__(self):
return '%s: (%s) %s' % (self.id,self.expr,map(None,self.ids))
-
+
__str__ = __repr__
@@ -63,7 +63,7 @@
try:
if eval(self.expr): self.ids.insert(documentId)
- except:
+ except:
LOG('FilteredSet',WARNING,'eval() failed',\
'Object: %s, expr: %s' % (o.getId(),self.expr),\
sys.exc_info())
=== Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 1.8 => 1.9 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py:1.8 Thu Apr 25 08:44:02 2002
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py Wed Aug 14 18:19:34 2002
@@ -1,19 +1,19 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
__version__ = '$Id$'
-from Products.PluginIndexes import PluggableIndex
+from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest
from Globals import Persistent, DTMLFile
@@ -28,7 +28,7 @@
class TopicIndex(Persistent, Implicit, SimpleItem):
""" A TopicIndex maintains a set of FilteredSet objects.
- Every FilteredSet object consists of an expression and
+ Every FilteredSet object consists of an expression and
and IISet with all Ids of indexed objects that eval with
this expression to 1.
"""
@@ -36,9 +36,9 @@
__implements__ = (PluggableIndex.PluggableIndexInterface,)
meta_type="TopicIndex"
-
+
manage_options= (
- {'label': 'FilteredSets',
+ {'label': 'FilteredSets',
'action': 'manage_workspace',
'help': ('TopicIndex','TopicIndex_searchResults.stx')},
)
@@ -51,17 +51,17 @@
self.id = id
self.filteredSets = OOBTree()
# experimental code for specifing the operator
- self.operators = ('or','and')
+ self.operators = ('or','and')
self.defaultOperator = 'or'
def getId(self): return self.id
-
+
def clear(self):
""" clear everything """
self.filteredSets = OOBTree()
-
+
def index_object(self, documentId, obj ,threshold=100):
""" hook for (Z)Catalog """
@@ -92,8 +92,8 @@
def keys(self): pass
- def values(self): pass
- def items(self): pass
+ def values(self): pass
+ def items(self): pass
def search(self,filterId):
@@ -102,7 +102,7 @@
return self.filteredSets[filterId].getIds()
- def _apply_index(self, request, cid=''):
+ def _apply_index(self, request, cid=''):
""" hook for (Z)Catalog
request mapping type (usually {"topic": "..." }
cid ???
@@ -126,10 +126,10 @@
if res:
return res, (self.id,)
- else:
+ else:
return IISet(), (self.id,)
-
+
def uniqueValues(self,name=None,withLength=0):
""" needed to be consistent with the interface """
@@ -147,26 +147,26 @@
if self.filteredSets.has_key(filterId):
raise KeyError,\
- 'A FilteredSet with this name already exists: %s' % filterId
+ 'A FilteredSet with this name already exists: %s' % filterId
self.filteredSets[filterId] = \
FilteredSet.factory(filterId, typeFilteredSet, expr)
def delFilteredSet(self,filterId):
-
+
if not self.filteredSets.has_key(filterId):
raise KeyError,\
- 'no such FilteredSet: %s' % filterId
+ 'no such FilteredSet: %s' % filterId
del self.filteredSets[filterId]
def clearFilteredSet(self,filterId):
-
+
if not self.filteredSets.has_key(filterId):
raise KeyError,\
- 'no such FilteredSet: %s' % filterId
+ 'no such FilteredSet: %s' % filterId
self.filteredSets[filterId].clear()
=== Zope/lib/python/Products/PluginIndexes/TopicIndex/__init__.py 1.2 => 1.3 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/__init__.py:1.2 Thu Feb 28 10:31:41 2002
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/__init__.py Wed Aug 14 18:19:34 2002
@@ -1,13 +1,12 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
-