From c2c38bb33784dc25029ba4b8bfa6ff3e11fa49e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Wed, 27 Sep 2017 20:23:43 +0200 Subject: [PATCH 01/14] Timestamp zulu can also be a z instead h and other small improvements --- ogn/__init__.py | 0 ogn/parser/parse.py | 4 ++-- ogn/parser/pattern.py | 4 ++-- tests/parser/test_beacon.py | 1 + tests/parser/test_parse.py | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 ogn/__init__.py diff --git a/ogn/__init__.py b/ogn/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ogn/parser/parse.py b/ogn/parser/parse.py index f04c5d1..c5d9e61 100644 --- a/ogn/parser/parse.py +++ b/ogn/parser/parse.py @@ -15,8 +15,8 @@ def parse_aprs(message, reference_date=None, reference_time=None): match_position = re.search(PATTERN_APRS_POSITION, message) if match_position: return {'name': match_position.group('callsign'), - 'receiver_name': match_position.group('receiver'), 'dstcall': match_position.group('dstcall'), + 'receiver_name': match_position.group('receiver'), 'timestamp': createTimestamp(match_position.group('time'), reference_date, reference_time), 'latitude': parseAngle('0' + match_position.group('latitude') + (match_position.group('latitude_enhancement') or '0')) * (-1 if match_position.group('latitude_sign') == 'S' else 1), @@ -32,8 +32,8 @@ def parse_aprs(message, reference_date=None, reference_time=None): match_status = re.search(PATTERN_APRS_STATUS, message) if match_status: return {'name': match_status.group('callsign'), - 'receiver_name': match_status.group('receiver'), 'dstcall': match_status.group('dstcall'), + 'receiver_name': match_status.group('receiver'), 'timestamp': createTimestamp(match_status.group('time'), reference_date, reference_time), 'comment': match_status.group('comment')} diff --git a/ogn/parser/pattern.py b/ogn/parser/pattern.py index c166e89..4093e1f 100644 --- a/ogn/parser/pattern.py +++ b/ogn/parser/pattern.py @@ -1,8 +1,8 @@ import re -PATTERN_APRS_POSITION = re.compile(r"^(?P.+?)>(?P[A-Z0-9]+),.+,(?P.+?):/(?P