Skip to content

Commit

Permalink
Add deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Wurster committed Oct 27, 2015
1 parent 4ebe26f commit e7224d1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ais/compatibility/__init__.py
@@ -0,0 +1,7 @@
import warnings

warnings.warn(
"The compatability module is deprecated and will be removed in 1.0",
FutureWarning,
stacklevel=2
)
7 changes: 7 additions & 0 deletions ais/stream/__init__.py
Expand Up @@ -2,10 +2,17 @@

import sys
import traceback
import warnings

import ais
from ais.stream import checksum

warnings.warn(
"The stream module is deprecated and will be removed in 1.0",
FutureWarning,
stacklevel=2
)


def ErrorPrinter(e,
stats,
Expand Down
19 changes: 16 additions & 3 deletions bin/aisdecode
@@ -1,4 +1,10 @@
#! /usr/bin/env python
#!/usr/bin/env python

"""
DEPRECATED: Will be removed in v1.0
"""

import warnings

import ais
import sys
Expand All @@ -14,6 +20,13 @@ try:
except:
msgpack = None


warnings.warn(
"This utility is deprecated and will be removed in 1.0",
FutureWarning,
stacklevel=2)


args = {"encoding": "json"}
files = []
for arg in sys.argv[1:]:
Expand All @@ -37,7 +50,7 @@ for key in ("uscg", "validate_checksum", "verbose", "allow_unknown", "treat_ab_e
args[key] = args[key] == 'True'

if "help" in args:
print """Usage: aisdecode [OPTIONS] < INFILE.nmea > OUTFILE.json
print("""Usage: aisdecode [OPTIONS] < INFILE.nmea > OUTFILE.json
Available opptions:
--gpsd Use gpsd compatible output
--copy-tagblock-timestamp=False
Expand All @@ -57,7 +70,7 @@ Available opptions:
--uscg=False
--validate_checksum=False
"""
""")
sys.exit(0)

encoding = args.pop('encoding', 'json')
Expand Down

0 comments on commit e7224d1

Please sign in to comment.