Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
d3921882
Commit
d3921882
authored
9 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Plain Diff
merge
parents
a824aa37
fadb9072
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/Makefile
+1
-1
1 addition, 1 deletion
examples/Makefile
lib/python/labcomm2014/LabComm.py
+10
-6
10 additions, 6 deletions
lib/python/labcomm2014/LabComm.py
with
11 additions
and
7 deletions
examples/Makefile
+
1
−
1
View file @
d3921882
...
@@ -17,7 +17,7 @@ ifeq ($(UNAME_S),Darwin)
...
@@ -17,7 +17,7 @@ ifeq ($(UNAME_S),Darwin)
else
else
cd
simple
;
sh compile.sh
&&
sh run.sh
cd
simple
;
sh compile.sh
&&
sh run.sh
$(
MAKE
)
-C
wiki_example
test
$(
MAKE
)
-C
wiki_example
test
$(
MAKE
)
-C
user_types
test
$(
MAKE
)
-C
user_types
all
endif
endif
$(
MAKE
)
-C
duck_typing
test
$(
MAKE
)
-C
duck_typing
test
$(
MAKE
)
-C
twoway
test
$(
MAKE
)
-C
twoway
test
...
...
This diff is collapsed.
Click to expand it.
lib/python/labcomm2014/LabComm.py
+
10
−
6
View file @
d3921882
...
@@ -637,8 +637,7 @@ class struct(type_decl):
...
@@ -637,8 +637,7 @@ class struct(type_decl):
return
not
self
.
__eq__
(
other
)
return
not
self
.
__eq__
(
other
)
def
__hash__
(
self
):
def
__hash__
(
self
):
tmp
=
str
(
self
.
field
)
return
hash
(
self
.
__class__
)
^
hash
(
self
.
field
)
return
hash
(
self
.
__class__
)
^
hash
(
tmp
)
def
encode_decl
(
self
,
encoder
):
def
encode_decl
(
self
,
encoder
):
encoder
.
encode_type
(
i_STRUCT
)
encoder
.
encode_type
(
i_STRUCT
)
...
@@ -918,8 +917,8 @@ class Decoder(Codec):
...
@@ -918,8 +917,8 @@ class Decoder(Codec):
self
.
version
=
version
self
.
version
=
version
self
.
handlers
=
{}
self
.
handlers
=
{}
def
register_handler
(
self
,
sig
,
handler
):
def
register_handler
(
self
,
decl
,
handler
):
self
.
handlers
[
str
(
sig
)
]
=
handler
self
.
handlers
[
decl
]
=
handler
def
unpack
(
self
,
format
):
def
unpack
(
self
,
format
):
size
=
packer
.
calcsize
(
format
)
size
=
packer
.
calcsize
(
format
)
...
@@ -956,11 +955,16 @@ class Decoder(Codec):
...
@@ -956,11 +955,16 @@ class Decoder(Codec):
data
,
decl
=
self
.
decode
()
data
,
decl
=
self
.
decode
()
if
decl
:
if
decl
:
if
data
!=
None
:
if
data
!=
None
:
if
str
(
decl
)
in
self
.
handlers
:
if
decl
in
self
.
handlers
:
handler
=
self
.
handlers
[
str
(
decl
)
]
handler
=
self
.
handlers
[
decl
]
handler
(
data
)
handler
(
data
)
else
:
else
:
print
(
"
No handler for %s
"
%
decl
.
name
)
print
(
"
No handler for %s
"
%
decl
.
name
)
for
key
,
value
in
self
.
handlers
.
iteritems
():
if
key
==
decl
:
print
"
but value %s == decl %s
"
%
(
key
,
decl
)
print
"
hashes %d : %d
"
%
(
hash
(
key
),
hash
(
decl
))
raise
Exception
()
def
decode
(
self
):
def
decode
(
self
):
while
True
:
while
True
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment