[Checkins] SVN: zc.relationship/trunk/src/zc/relationship/ Because of the recent changes in the BTRees package the index module needs to

Jürgen Kartnaller juergen at kartnaller.at
Tue Feb 6 07:24:36 EST 2007


Log message for revision 72392:
  Because of the recent changes in the BTRees package the index module needs to
  ignore ModuleTypes when getting module tools.
  

Changed:
  U   zc.relationship/trunk/src/zc/relationship/README.txt
  U   zc.relationship/trunk/src/zc/relationship/index.py

-=-
Modified: zc.relationship/trunk/src/zc/relationship/README.txt
===================================================================
--- zc.relationship/trunk/src/zc/relationship/README.txt	2007-02-06 08:37:42 UTC (rev 72391)
+++ zc.relationship/trunk/src/zc/relationship/README.txt	2007-02-06 12:24:33 UTC (rev 72392)
@@ -504,7 +504,7 @@
 
     >>> res = ix.findRelationshipTokenSet(q({'subjects': people['Fred']}))
     >>> res # doctest: +ELLIPSIS
-    <BTrees._IFBTree.IFTreeSet object at ...>
+    <BTrees.IFBTree.IFTreeSet object at ...>
     >>> [intids.getObject(t) for t in res]
     [<(<Person 'Fred'>,) has the role of (<Role 'Project Manager'>,)>]
 
@@ -519,7 +519,7 @@
 
     >>> res = ix.findValueTokenSet(list(res)[0], 'subjects')
     >>> res # doctest: +ELLIPSIS
-    <BTrees._IFBTree.IFTreeSet object at ...>
+    <BTrees.IFBTree.IFTreeSet object at ...>
     >>> [load(t, ix, {}) for t in res]
     [<Person 'Fred'>]
 
@@ -553,7 +553,7 @@
     ...     q({'reltype': 'has the role of'})})
     ... doctest: +ELLIPSIS
     >>> res # doctest: +ELLIPSIS
-    <BTrees._IFBTree.IFTreeSet object at ...>
+    <BTrees.IFBTree.IFTreeSet object at ...>
     >>> [intids.getObject(t) for t in res]
     [<(<Person 'Fred'>,) has the role of (<Role 'Project Manager'>,)>]
 

Modified: zc.relationship/trunk/src/zc/relationship/index.py
===================================================================
--- zc.relationship/trunk/src/zc/relationship/index.py	2007-02-06 08:37:42 UTC (rev 72391)
+++ zc.relationship/trunk/src/zc/relationship/index.py	2007-02-06 12:24:33 UTC (rev 72392)
@@ -1,4 +1,5 @@
 import re
+import types
 
 import persistent
 import persistent.interfaces
@@ -82,10 +83,13 @@
     res = {'multiunion': None}
     for nm in dir(module):
         if not nm.startswith('_') and not nm.endswith('Iterator'):
+            value = getattr(module, nm)
+            if isinstance(value, types.ModuleType):
+                continue
             if re.match('[A-Z][A-Z]', nm):
-                res[nm[2:]] = getattr(module, nm)
+                res[nm[2:]] = value
             else:
-                res[nm] = getattr(module, nm)
+                res[nm] = value
     return res
 
 class Index(persistent.Persistent, zope.app.container.contained.Contained):



More information about the Checkins mailing list