Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e7224d1

Browse files
author
Kevin Wurster
committedOct 27, 2015
Add deprecation warnings
1 parent 4ebe26f commit e7224d1

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed
 

‎ais/compatibility/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import warnings
2+
3+
warnings.warn(
4+
"The compatability module is deprecated and will be removed in 1.0",
5+
FutureWarning,
6+
stacklevel=2
7+
)

‎ais/stream/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
import sys
44
import traceback
5+
import warnings
56

67
import ais
78
from ais.stream import checksum
89

10+
warnings.warn(
11+
"The stream module is deprecated and will be removed in 1.0",
12+
FutureWarning,
13+
stacklevel=2
14+
)
15+
916

1017
def ErrorPrinter(e,
1118
stats,

‎bin/aisdecode

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
#! /usr/bin/env python
1+
#!/usr/bin/env python
2+
3+
"""
4+
DEPRECATED: Will be removed in v1.0
5+
"""
6+
7+
import warnings
28

39
import ais
410
import sys
@@ -14,6 +20,13 @@ try:
1420
except:
1521
msgpack = None
1622

23+
24+
warnings.warn(
25+
"This utility is deprecated and will be removed in 1.0",
26+
FutureWarning,
27+
stacklevel=2)
28+
29+
1730
args = {"encoding": "json"}
1831
files = []
1932
for arg in sys.argv[1:]:
@@ -37,7 +50,7 @@ for key in ("uscg", "validate_checksum", "verbose", "allow_unknown", "treat_ab_e
3750
args[key] = args[key] == 'True'
3851

3952
if "help" in args:
40-
print """Usage: aisdecode [OPTIONS] < INFILE.nmea > OUTFILE.json
53+
print("""Usage: aisdecode [OPTIONS] < INFILE.nmea > OUTFILE.json
4154
Available opptions:
4255
--gpsd Use gpsd compatible output
4356
--copy-tagblock-timestamp=False
@@ -57,7 +70,7 @@ Available opptions:
5770
5871
--uscg=False
5972
--validate_checksum=False
60-
"""
73+
""")
6174
sys.exit(0)
6275

6376
encoding = args.pop('encoding', 'json')

0 commit comments

Comments
 (0)
Please sign in to comment.