diff --git a/ogn/parser/parse.py b/ogn/parser/parse.py index 3703a00..2dedd97 100644 --- a/ogn/parser/parse.py +++ b/ogn/parser/parse.py @@ -87,7 +87,7 @@ def parse_aprs(message, reference_timestamp=None): result.update({ 'name': match.group('callsign'), 'dstcall': match.group('dstcall'), - 'relay': match.group('relay') if match.group('relay') else None, + 'relay': match.group('relay'), 'receiver_name': match.group('receiver'), 'timestamp': createTimestamp(match_position.group('time'), reference_timestamp), 'latitude': parseAngle('0' + match_position.group('latitude') + (match_position.group('latitude_enhancement') or '0')) * # noqa: W504 diff --git a/ogn/parser/pattern.py b/ogn/parser/pattern.py index 1702caf..711e6c8 100644 --- a/ogn/parser/pattern.py +++ b/ogn/parser/pattern.py @@ -1,6 +1,6 @@ import re -PATTERN_APRS = re.compile(r"^(?P.+?)>(?P[A-Z0-9]+),((?P[A-Za-z0-9]+)\*)?.*,(?P.+?):(?P(.))(?P.*)$") +PATTERN_APRS = re.compile(r"^(?P.+?)>(?P[A-Z0-9]+)(,((?P[A-Za-z0-9]+)\*)?.*,(?P.+?))?:(?P(.))(?P.*)$") PATTERN_APRS_POSITION = re.compile(r"^(?P