[Zope-Checkins] SVN: Zope/branches/ajung-epi-integration/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py fixed __init__()

Andreas Jung andreas at andreas-jung.com
Fri Apr 8 10:38:37 EDT 2005


Log message for revision 29913:
  fixed __init__()
  

Changed:
  U   Zope/branches/ajung-epi-integration/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py

-=-
Modified: Zope/branches/ajung-epi-integration/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/branches/ajung-epi-integration/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2005-04-08 14:15:25 UTC (rev 29912)
+++ Zope/branches/ajung-epi-integration/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2005-04-08 14:38:37 UTC (rev 29913)
@@ -57,12 +57,31 @@
 
     query_options = ("query", "level", "operator", "depth", "navtree")
 
-    def ___init__(self,id,caller=None):
+    def __init__(self, id, extra=None, caller=None):
+        """ PathIndex supports indexed_attrs """
+
+        def get(o, k, default):
+            if isinstance(o, dict):
+                return o.get(k, default)
+            else:
+                return getattr(o, k, default)
+
         self.id = id
         self.operators = ('or','and')
         self.useOperator = 'or'
         self.clear()
 
+        attrs = get(extra, 'indexed_attrs', None)
+        if attrs is None:
+            return
+        if isinstance(attrs, str):
+            attrs = attrs.split(',')
+        attrs = filter(None, [a.strip() for a in attrs])
+
+        if attrs:
+            # We only index the first attribute so snip off the rest
+            self.indexed_attrs = tuple(attrs[:1])
+
     def clear(self):
         self._depth = 0
         self._index = OOBTree()
@@ -122,27 +141,7 @@
 
 
 
-    def __init__(self, id, extra=None, caller=None):
-        """ ExtendedPathIndex supports indexed_attrs """
-        self.___init__( id, caller)
 
-        def get(o, k, default):
-            if isinstance(o, dict):
-                return o.get(k, default)
-            else:
-                return getattr(o, k, default)
-
-        attrs = get(extra, 'indexed_attrs', None)
-        if attrs is None:
-            return
-        if isinstance(attrs, str):
-            attrs = attrs.split(',')
-        attrs = filter(None, [a.strip() for a in attrs])
-
-        if attrs:
-            # We only index the first attribute so snip off the rest
-            self.indexed_attrs = tuple(attrs[:1])
-
     def index_object(self, docid, obj ,threshold=100):
         """ hook for (Z)Catalog """
 



More information about the Zope-Checkins mailing list