Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI issues #55

Merged
merged 4 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 1 addition & 3 deletions pyulog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,10 @@ def _find_sync(self, last_n_bytes=-1):
current_file_position = self._file_handle.seek(current_file_position - len(chunk)\
+ chunk_index + len(ULog.SYNC_BYTES), 0)
sync_seq_found = True
break
roman-dvorak marked this conversation as resolved.
Show resolved Hide resolved

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

# seek back 7 bytes to handle boundary condition and read next chunk
current_file_position = self._file_handle.seek(-(len(ULog.SYNC_BYTES)-1), 1)
Expand Down Expand Up @@ -784,4 +783,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