Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pyulog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def _find_sync(self, last_n_bytes=-1):
sync_seq_found = True
break

elif last_n_bytes != -1:
if last_n_bytes != -1:
# we read the whole last_n_bytes and did not find sync
break

Expand Down Expand Up @@ -784,4 +784,3 @@ def get_version_info_str(self, key_name='ver_sw_release'):
elif version[3] < 255: type_str = ' (RC)'
return 'v{}.{}.{}{}'.format(version[0], version[1], version[2], type_str)
return None

5 changes: 3 additions & 2 deletions pyulog/extract_gps_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import argparse
import os
import sys

from .core import ULog

Expand Down Expand Up @@ -55,15 +56,15 @@ def is_valid_directory(parser, arg):

if len(data) == 0:
print("File {0} does not contain gps_dump messages!".format(ulog_file_name))
exit(0)
sys.exit(0)

gps_dump_data = data[0]

# message format check
field_names = [f.field_name for f in gps_dump_data.field_data]
if not 'len' in field_names or not 'data[0]' in field_names:
print('Error: gps_dump message has wrong format')
exit(-1)
sys.exit(-1)

if len(ulog.dropouts) > 0:
print("Warning: file contains {0} dropouts".format(len(ulog.dropouts)))
Expand Down