Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EdosL0Util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
SIPS
EdosL0Util
Commits
3c46b65d
Commit
3c46b65d
authored
7 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
fix issue with prune_packet script
parent
ff8631d1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
edosl0util/stream.py
+1
-0
1 addition, 0 deletions
edosl0util/stream.py
scripts/prune_packets.py
+4
-10
4 additions, 10 deletions
scripts/prune_packets.py
with
5 additions
and
10 deletions
edosl0util/stream.py
+
1
−
0
View file @
3c46b65d
...
@@ -211,6 +211,7 @@ class PacketStream(object):
...
@@ -211,6 +211,7 @@ class PacketStream(object):
if
len
(
self
.
_seek_cache
):
if
len
(
self
.
_seek_cache
):
return
self
.
_seek_cache
.
popleft
()
return
self
.
_seek_cache
.
popleft
()
try
:
try
:
# namedtuple('Tracker', ['h1', 'h2', 'size', 'offset', 'data'])
h1
,
h2
,
data_size
,
offset
,
data
=
self
.
_stream
.
next
()
h1
,
h2
,
data_size
,
offset
,
data
=
self
.
_stream
.
next
()
except
PacketTooShort
as
err
:
except
PacketTooShort
as
err
:
if
self
.
_fail_on_tooshort
:
if
self
.
_fail_on_tooshort
:
...
...
This diff is collapsed.
Click to expand it.
scripts/prune_packets.py
+
4
−
10
View file @
3c46b65d
...
@@ -14,25 +14,19 @@ parser.add_argument('outfile')
...
@@ -14,25 +14,19 @@ parser.add_argument('outfile')
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
def
pack_hdr_bytes
(
hdr
):
return
c
.
string_at
(
c
.
byref
(
hdr
),
c
.
sizeof
(
hdr
))
with
open
(
args
.
outfile
,
'
wb
'
)
as
fptr
:
with
open
(
args
.
outfile
,
'
wb
'
)
as
fptr
:
idx
=
0
idx
=
0
for
pkt
in
stream
.
P
acket
S
tream
(
open
(
args
.
pdsfile
)):
for
pkt
in
stream
.
jpss_p
acket
_s
tream
(
open
(
args
.
pdsfile
)):
h1
=
pkt
.
primary_header
h1
=
pkt
.
primary_header
h2
=
pkt
.
secondary_header
h2
=
pkt
.
secondary_header
if
h2
:
if
h2
:
h1
.
data_length_minus1
=
c
.
sizeof
(
h2
)
-
1
h1
.
data_length_minus1
=
c
.
sizeof
(
h2
)
fptr
.
write
(
h1
)
fptr
.
write
(
h1
)
if
pkt
.
stamp
:
h2
.
packet_count
=
0
fptr
.
write
(
h2
)
fptr
.
write
(
h2
)
fptr
.
write
(
'
\xff
'
)
else
:
else
:
h1
.
data_length_minus1
=
0
h1
.
data_length_minus1
=
0
fptr
.
write
(
h1
)
fptr
.
write
(
h1
)
fptr
.
write
(
'
x
'
)
fptr
.
write
(
'
\xff
'
)
idx
+=
1
idx
+=
1
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