[Zope-Checkins] CVS: Zope/lib/python/AccessControl - SimpleObjectPolicies.py:1.12.70.3

Brian Lloyd brian at zope.com
Tue Jan 27 15:40:12 EST 2004


Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv7739

Modified Files:
      Tag: Zope-2_7-branch
	SimpleObjectPolicies.py 
Log Message:
merge btree policy fix


=== Zope/lib/python/AccessControl/SimpleObjectPolicies.py 1.12.70.2 => 1.12.70.3 ===
--- Zope/lib/python/AccessControl/SimpleObjectPolicies.py:1.12.70.2	Fri Jan 16 16:04:52 2004
+++ Zope/lib/python/AccessControl/SimpleObjectPolicies.py	Tue Jan 27 15:40:11 2004
@@ -83,3 +83,34 @@
     if not (isinstance(allowed, int) or isinstance(allowed, dict)):
         raise ValueError, "The 'allowed' argument must be an int or dict."
     ContainerAssertions[Type] = allowed
+
+#
+#   WAAAA!
+#
+from BTrees.OOBTree import OOBTree, OOBucket, OOSet
+from BTrees.OIBTree import OIBTree, OIBucket, OISet
+from BTrees.IOBTree import IOBTree, IOBucket, IOSet
+from BTrees.IIBTree import IIBTree, IIBucket, IISet
+
+for tree_type, has_values in [(OOBTree, 1),
+                              (OOBucket, 1),
+                              (OOSet, 0),
+                              (OIBTree, 1),
+                              (OIBucket, 1),
+                              (OISet, 0),
+                              (IOBTree, 1),
+                              (IOBucket, 1),
+                              (IOSet, 0),
+                              (IIBTree, 1),
+                              (IIBucket, 1),
+                              (IISet, 0),
+                             ]:
+    tree = tree_type()
+    key_type = type(tree.keys())
+
+    if key_type is not ListType: # lists have their own declarations
+        allow_type(key_type)
+
+    if has_values:
+        assert key_type is type(tree.values())
+        assert key_type is type(tree.items())




More information about the Zope-Checkins mailing list