Commit 73f2165f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 24d61b19
......@@ -165,13 +165,6 @@ class Bucket(object):
# The structure is represented as Tree and Bucket nodes.
def StructureOf(znode):
ztype = _zclassify(znode)
"""
typ = type(znode)
is_tree = ("Tree" in typ.__name__)
is_set = ("Set" in typ.__name__)
is_bucket = (("Bucket" in typ.__name__) or re.match("..Set", typ.__name__))
is_map = (not is_set)
"""
if ztype.is_zbucket:
keys, _ = zbcheck.crack_bucket(znode, ztype.is_map)
......@@ -198,9 +191,13 @@ def StructureOf(znode):
# Restructure reorganizes ZODB BTree instance (not Tree) according to specified
# structure.
def Restructure(ztree, newStructure):
#assert isztree(ztree) # XXX reenable, -> use zbcheck.classify
_ = _zclassify(ztree)
assert _.is_ztree
assert isinstance(newStructure, Tree)
ztreeType = type(ztree)
zbucketType = ztreeType._bucket_type
_bcheck(ztree) # verify ztree before our tweaks
# dict with all k->v from ztree
......@@ -434,7 +431,7 @@ def _zwalkBFS(ztree): # i[] of [](of nodes on each level)
assert _.is_ztree
ztreeType = type(ztree)
zbucketType = ztree._bucket_type
zbucketType = ztreeType._bucket_type
currentq = []
nextq = [ztree]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment