Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions ais/stream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import ais
from ais.stream import checksum
import time

warnings.warn(
"The stream module is deprecated and will be removed in 1.0",
Expand Down Expand Up @@ -154,6 +155,7 @@ def normalize(nmea=sys.stdin,
treat_ab_equal=False,
pass_invalid_checksums=False,
allow_missing_timestamps=False,
missing_timestamp_to_now=False,
errorcb=ErrorPrinter,
stats=None,
**kw):
Expand Down Expand Up @@ -324,6 +326,7 @@ def decode(nmea=sys.stdin,
errorcb=ErrorPrinter,
keep_nmea=False,
stats=None,
missing_timestamp_to_now=False,
**kw):
"""Decodes a stream of AIS messages. Takes the same arguments as normalize."""

Expand All @@ -341,6 +344,8 @@ def report_error(e):
res.update(tagblock)
if keep_nmea:
res['nmea'] = origline
if missing_timestamp_to_now and 'tagblock_timestamp' not in res:
res['tagblock_timestamp'] = time.time()
yield res
except TooManyErrorsError:
raise
Expand Down
1 change: 1 addition & 0 deletions bin/aisdecode
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Available opptions:
--treat_ab_equal
--pass_invalid_checksums
--allow_missing_timestamps
--missing_timestamp_to_now

--uscg=False
--validate_checksum=False
Expand Down