Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
23d7bf99
Commit
23d7bf99
authored
Oct 27, 2014
by
Anders Blomdell
Browse files
Removed dependency on python typedefs
parent
36ec36fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/user_types/example_encoder.py
View file @
23d7bf99
...
...
@@ -8,45 +8,31 @@ if __name__ == '__main__':
version
=
sys
.
argv
[
2
]
if
len
(
sys
.
argv
)
==
3
else
"LabComm2013"
encoder
=
labcomm
.
Encoder
(
labcomm
.
StreamWriter
(
open
(
sys
.
argv
[
1
],
'w'
)),
version
)
encoder
.
add_decl
(
test
.
twoLines
.
signature
)
l1
=
test
.
line
()
c1s
=
test
.
point
()
c1sx
=
test
.
coord
()
c1sx
.
val
=
1
c1sy
=
test
.
coord
()
c1sy
.
val
=
11
c1s
.
x
=
c1sx
;
c1s
.
y
=
c1sy
;
c1e
=
test
.
point
()
c1ex
=
test
.
coord
()
c1ex
.
val
=
2
c1ey
=
test
.
coord
()
c1ey
.
val
=
22
c1e
.
x
=
c1ex
;
c1e
.
y
=
c1ey
;
l1
.
start
=
c1s
l1
.
end
=
c1e
l2
=
test
.
line
()
c2s
=
test
.
point
()
c2sx
=
test
.
coord
()
c2sx
.
val
=
3
c2sy
=
test
.
coord
()
c2sy
.
val
=
33
c2s
.
x
=
c2sx
;
c2s
.
y
=
c2sy
;
c2e
=
test
.
point
()
c2ex
=
test
.
coord
()
c2ex
.
val
=
4
c2ey
=
test
.
coord
()
c2ey
.
val
=
44
c2e
.
x
=
c2ex
;
c2e
.
y
=
c2ey
;
l2
.
start
=
c2s
l2
.
end
=
c2e
tl
=
test
.
twoLines
()
tl
.
l1
=
l1
tl
.
l2
=
l2
tl
.
f
=
test
.
foo
()
tl
.
f
.
a
=
10
;
tl
.
f
.
b
=
20
;
tl
.
f
.
c
=
False
;
tl
=
dict
(
l1
=
dict
(
start
=
dict
(
x
=
dict
(
val
=
1
),
y
=
dict
(
val
=
11
)
),
end
=
dict
(
x
=
dict
(
val
=
2
),
y
=
dict
(
val
=
22
)
)
),
l2
=
dict
(
start
=
dict
(
x
=
dict
(
val
=
3
),
y
=
dict
(
val
=
33
)
),
end
=
dict
(
x
=
dict
(
val
=
4
),
y
=
dict
(
val
=
44
)
)
),
f
=
dict
(
a
=
10
,
b
=
20
,
c
=
False
)
)
encoder
.
encode
(
tl
,
test
.
twoLines
.
signature
)
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