mirror of https://github.com/ArduPilot/ardupilot
Tools: scripts: mavlink_parse: improve robustness
This commit is contained in:
parent
adf87f360e
commit
ce98da7aa0
|
@ -198,7 +198,12 @@ class MAVLinkDetector:
|
|||
folder = file.parent.stem
|
||||
if folder in exclude_libraries:
|
||||
continue
|
||||
|
||||
try:
|
||||
text = file.read_text()
|
||||
except FileNotFoundError: # Broken symlink
|
||||
continue
|
||||
|
||||
source = f'{folder}/{file.name}'
|
||||
if file == self.COMMON_FILE:
|
||||
for mavlink, ap_message in self.find_requestable_messages(text):
|
||||
|
@ -267,7 +272,11 @@ class MAVLinkDetector:
|
|||
def get_stream_groups(self, vehicle):
|
||||
stream_groups = ['stream_groups']
|
||||
|
||||
try:
|
||||
text = (self.BASE_DIR / vehicle / self.STREAM_GROUP_FILE).read_text()
|
||||
except FileNotFoundError: # No stream groups
|
||||
return []
|
||||
|
||||
for group_name, message_data in self.STREAM_GROUPS.findall(text):
|
||||
stream_groups.extend(sorted(
|
||||
MAVLinkMessage(self._ap_to_mavlink.get(ap_message, ap_message),
|
||||
|
|
Loading…
Reference in New Issue