Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
db6c8a01
Commit
db6c8a01
authored
May 26, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b2bd316e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
wcfs/testprog/treegen.py
wcfs/testprog/treegen.py
+11
-5
No files found.
wcfs/testprog/treegen.py
View file @
db6c8a01
...
@@ -121,7 +121,7 @@ class ZCtx(object):
...
@@ -121,7 +121,7 @@ class ZCtx(object):
zblk
=
ZBlk
()
zblk
=
ZBlk
()
zblk
.
setblkdata
(
v
)
zblk
.
setblkdata
(
v
)
zctx
.
valdict
[
v
]
=
zblk
zctx
.
valdict
[
v
]
=
zblk
commit
(
'treegen/values
->
%r'
%
valv
)
commit
(
'treegen/values
: init
%r'
%
valv
)
# close release resources associated with zctx.
# close release resources associated with zctx.
def
close
(
zctx
):
def
close
(
zctx
):
...
@@ -138,7 +138,9 @@ class ZCtx(object):
...
@@ -138,7 +138,9 @@ class ZCtx(object):
return
k
return
k
raise
KeyError
(
"%r not found in value registry"
%
(
vobj
,))
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
@
func
def
Trees
(
zstor
,
r
):
def
Trees
(
zstor
,
r
):
zctx
=
ZCtx
(
zstor
)
zctx
=
ZCtx
(
zstor
)
...
@@ -147,10 +149,14 @@ def Trees(zstor, r):
...
@@ -147,10 +149,14 @@ def Trees(zstor, r):
trees
=
zctx
.
root
.
get
(
'treegen/trees'
)
trees
=
zctx
.
root
.
get
(
'treegen/trees'
)
if
trees
is
None
:
if
trees
is
None
:
trees
=
zctx
.
root
[
'treegen/trees'
]
=
PersistentMapping
()
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 trailing \n
treetxt
=
treetxt
.
rstrip
()
# trim trailin \n
tree
=
zctx
.
TopoDecode
(
treetxt
)
tree
=
zctx
.
TopoDecode
(
treetxt
)
ztree
=
trees
[
treetxt
]
=
XLOTree
()
ztree
=
trees
[
treetxt
]
=
XLOTree
()
zctx
.
zconn
.
add
(
ztree
)
# so that restructure can see we are working under zconn
zctx
.
zconn
.
add
(
ztree
)
# so that restructure can see we are working under zconn
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment