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
d719ee18
Commit
d719ee18
authored
Jun 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e36acaf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
wcfs/testprog/treegen.py
wcfs/testprog/treegen.py
+14
-18
No files found.
wcfs/testprog/treegen.py
View file @
d719ee18
...
...
@@ -158,15 +158,7 @@ def Trees(zstor, r):
xprint
(
"tree.srv start @%s root=%s"
%
(
ashex
(
head
),
ashex
(
ztree
.
_p_oid
)))
treetxtPrev
=
zctx
.
ztreetxt
(
ztree
)
# XXX dup wrt AllStructsSrv
while
1
:
treetxt
=
r
.
readline
()
if
treetxt
==
''
:
break
# EOF
treetxt
=
treetxt
.
rstrip
()
# trim trailing \n
if
treetxt
.
startswith
(
'#'
):
continue
# skip comments
for
treetxt
in
xreadlines
(
r
):
# mark tree as changed if the same topology is requested twice
# this ensures we can actually make a non-empty commit
if
treetxt
==
treetxtPrev
:
...
...
@@ -215,15 +207,7 @@ def Trees(zstor, r):
@
func
def
AllStructsSrv
(
r
):
xprint
(
'# allstructs.srv start'
)
# XXX dup wrt Trees
while
1
:
req
=
r
.
readline
()
if
req
==
''
:
break
# EOF
req
=
req
.
rstrip
()
# trim trailing \n
if
req
.
startswith
(
'#'
):
continue
# skip comments
for
req
in
xreadlines
(
r
):
# maxdepth maxsplit n(/seed) kv1 kv2
maxdepth
,
maxsplit
,
n
,
kv1txt
,
kv2txt
=
req
.
split
()
maxdepth
=
int
(
maxdepth
)
...
...
@@ -414,6 +398,18 @@ def TopoDecode(zctx, text):
return
xbtree
.
TopoDecode
(
text
,
zctx
.
vdecode
)
# xreadlines iterates through lines in r skipping comments.
def
xreadlines
(
r
):
while
1
:
l
=
r
.
readline
()
if
l
==
''
:
break
# EOF
l
=
l
.
rstrip
()
# trim trailing \n
if
l
.
startswith
(
'#'
):
continue
# skip comments
yield
l
@
func
def
cmd_allstructs
(
argv
):
if
len
(
argv
)
!=
5
:
...
...
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