"""Manage a stream of NMEA TAG block messages. The TAG (Transport, Annotate, and Group) Block messages are defined in NMEA 4.0 section 7. Some providers violate the NMEA standard by using lower case letters in NMEA checksums. This module forces checksums to always be upper case. TODO(schwehr): Add a queue method to drop old groups caches. TODO(schwehr): Catch a wider variety of incomplete groups. TODO(schwehr): Compute running stats in the queue. """ import hashlib import logging import re import six import six.moves.queue as Queue import ais from ais import nmea from ais import nmea_messages from ais import util from ais import vdm logger = logging.getLogger('libais') # Added a decimal value to time beyond the normal TAG BLOCK spec. TAG_BLOCK_RE = re.compile(r""" (\\ (?P( ( c:(?P