Commit db6c8a01 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b2bd316e
......@@ -121,7 +121,7 @@ class ZCtx(object):
zblk = ZBlk()
zblk.setblkdata(v)
zctx.valdict[v] = zblk
commit('treegen/values -> %r' % valv)
commit('treegen/values: init %r' % valv)
# close release resources associated with zctx.
def close(zctx):
......@@ -138,7 +138,9 @@ class ZCtx(object):
return k
raise KeyError("%r not found in value registry" % (vobj,))
# XXX doc
# Trees generates tree structures given their topology encoding on input.
# See top-level documentation for details.
@func
def Trees(zstor, r):
zctx = ZCtx(zstor)
......@@ -147,10 +149,14 @@ def Trees(zstor, r):
trees = zctx.root.get('treegen/trees')
if trees is None:
trees = zctx.root['treegen/trees'] = PersistentMapping()
commit('mk treegen/trees')
commit('treegen/trees: init')
while 1:
treetxt = r.readline()
if treetxt == '':
break # EOF
for treetxt in r.readlines():
treetxt = treetxt.rstrip() # trim trailin \n
treetxt = treetxt.rstrip() # trim trailing \n
tree = zctx.TopoDecode(treetxt)
ztree = trees[treetxt] = XLOTree()
zctx.zconn.add(ztree) # so that restructure can see we are working under zconn
......
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