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
33f41ada
Commit
33f41ada
authored
10 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
put back TYPE_DEF, TYPE_BINDING, and PRAGMA in python decoder
parent
3d74e0ce
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/python/labcomm/LabComm.py
+21
-0
21 additions, 0 deletions
lib/python/labcomm/LabComm.py
with
21 additions
and
0 deletions
lib/python/labcomm/LabComm.py
+
21
−
0
View file @
33f41ada
...
...
@@ -157,6 +157,8 @@ DEFAULT_VERSION = "LabComm2014"
i_VERSION
=
0x01
i_SAMPLE_DEF
=
0x02
i_SAMPLE_REF
=
0x03
i_TYPE_DEF
=
0x04
i_TYPE_BINDING
=
0x05
i_PRAGMA
=
0x3f
i_USER
=
0x40
# ..0xffffffff
...
...
@@ -829,6 +831,13 @@ class Decoder(Codec):
for
_
in
xrange
(
length
):
self
.
decode_byte
()
# kludge, should really check if the index exists in self.version
def
skip_or_raise
(
self
,
length
,
index
):
if
usePacketLength
(
self
.
version
):
self
.
skip
(
length
)
else
:
raise
Exception
(
"
Invalid type index %d
"
%
index
)
def
decode
(
self
):
while
True
:
index
=
self
.
decode_type_number
()
...
...
@@ -847,6 +856,18 @@ class Decoder(Codec):
elif
index
==
i_SAMPLE_REF
:
decl
=
self
.
index_to_decl
[
index
].
decode_decl
(
self
)
value
=
None
elif
index
==
i_TYPE_DEF
:
self
.
skip_or_raise
(
length
,
index
)
decl
=
None
value
=
None
elif
index
==
i_TYPE_BINDING
:
self
.
skip_or_raise
(
length
,
index
)
decl
=
None
value
=
None
elif
index
==
i_PRAGMA
:
self
.
skip_or_raise
(
length
,
index
)
decl
=
None
value
=
None
elif
index
<
i_USER
:
raise
Exception
(
"
Invalid type index %d
"
%
index
)
else
:
...
...
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