[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex - FilteredSet.py:1.1.2.7 README.txt:1.1.2.2 TopicIndex.py:1.1.2.6

Andreas Jung andreas@zope.com
Tue, 16 Oct 2001 14:59:10 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex
In directory cvs.zope.org:/tmp/cvs-serv6889

Modified Files:
      Tag: ajung-topicindex
	FilteredSet.py README.txt TopicIndex.py 
Log Message:
cleanup


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py 1.1.2.6 => 1.1.2.7 ===
 
 class AttributeFilteredSet(FilteredSetBase):
+    """ The implementation of this FS is currently nonsense """
 
     meta_type = 'AttributeFilteredSet'
 
@@ -134,15 +135,13 @@
             if callable(attr):
                 attr = attr()
 
-        try:
-            if attr in self.expr:
-                self.ids.insert(documentId)
-        except: 
-            print 'sux'
+            try:
+                if attr in eval(self.expr):
+                    self.ids.insert(documentId)
+            except: 
+                pass
     
 
-
-
 class PythonFilteredSet(FilteredSetBase):
 
     meta_type = 'PythonFilteredSet'
@@ -170,7 +169,7 @@
         return PythonFilteredSet(f_id, expr)
 
     elif f_type=='AttributeFilteredSet':
-        return CatalogFilteredSet(f_id, expr)
+        return AttributeFilteredSet(f_id, expr)
 
     elif f_type=='CatalogFilteredSet':
         return CatalogFilteredSet(f_id, expr)


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/README.txt 1.1.2.1 => 1.1.2.2 ===
 
 
+
+  API
+
+    The TopicIndex implements the API for pluggable Indexes.
+    Additionall it provides the following functions to manage FilteredSets
+
+      -- addFilteredSet(Id, filterType, expression): 
+
+        -- Id:  unique Id for the FilteredSet
+ 
+        -- filterType:     'PythonFilteredSet'
+    
+        -- expression:  Python expression
+
+
+      -- delFilteredSet(Id):
+
+      -- clearFilteredSet(Id):
+     
+  


=== Zope/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 1.1.2.5 => 1.1.2.6 ===
         {'label': 'FilteredSets',     
          'action': 'manage_workspace',
-         'help': ('TopicIndex','TopicIndex_Settings.stx')},
+         'help': ('TopicIndex','TopicIndex_searchResults.stx')},
     )
 
     manage_workspace = DTMLFile('dtml/manageTopicIndex',globals())
@@ -252,6 +252,9 @@
     def manage_addFilteredSet(self, filterId, typeFilteredSet, expr, URL1, \
             REQUEST=None,RESPONSE=None):
         """ add a new filtered set """
+
+        if len(filterId)==0: raise RuntimeError,'Length of ID too short'
+        if len(expr)==0: raise RuntimeError,'Length of expression too short'
 
         self.addFilteredSet(filterId, typeFilteredSet, expr)