fix import error in Python3

This commit is contained in:
junzis
2017-03-23 16:10:22 +01:00
parent 1e82b5c59c
commit fefd26a787
6 changed files with 9 additions and 17 deletions
+2 -1
View File
@@ -17,8 +17,9 @@
A python package for decoding ABS-D messages. A python package for decoding ABS-D messages.
""" """
from __future__ import absolute_import, print_function, division
import math import math
import util from . import util
def df(msg): def df(msg):
+3 -4
View File
@@ -17,9 +17,8 @@
A python package for decoding ModeS (DF20, DF21) messages. A python package for decoding ModeS (DF20, DF21) messages.
""" """
import util from __future__ import absolute_import, print_function, division
from util import crc from . import util
def df(msg): def df(msg):
"""Get the downlink format (DF) number """Get the downlink format (DF) number
@@ -53,7 +52,7 @@ def icao(msg):
# raise RuntimeError("Message DF must be in (4, 5, 20, 21)") # raise RuntimeError("Message DF must be in (4, 5, 20, 21)")
return None return None
c0 = util.bin2int(crc(msg, encode=True)) c0 = util.bin2int(util.crc(msg, encode=True))
c1 = util.hex2int(msg[-6:]) c1 = util.hex2int(msg[-6:])
icao = '%06X' % (c0 ^ c1) icao = '%06X' % (c0 ^ c1)
return icao return icao
+1 -3
View File
@@ -1,6 +1,4 @@
import os, sys from pyModeS import adsb, ehs, util
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import adsb, ehs, util
# === Decode sample data file === # === Decode sample data file ===
+1 -3
View File
@@ -1,6 +1,4 @@
import os, sys from pyModeS import adsb
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import adsb
# === TEST ADS-B package === # === TEST ADS-B package ===
+1 -3
View File
@@ -1,6 +1,4 @@
import os, sys from pyModeS import ehs
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import ehs
def test_ehs_icao(): def test_ehs_icao():
+1 -3
View File
@@ -1,6 +1,4 @@
import os, sys from pyModeS import util
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import util
def test_hex2bin(): def test_hex2bin():