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

View File

@ -17,8 +17,9 @@
A python package for decoding ABS-D messages.
"""
from __future__ import absolute_import, print_function, division
import math
import util
from . import util
def df(msg):

View File

@ -17,9 +17,8 @@
A python package for decoding ModeS (DF20, DF21) messages.
"""
import util
from util import crc
from __future__ import absolute_import, print_function, division
from . import util
def df(msg):
"""Get the downlink format (DF) number
@ -53,7 +52,7 @@ def icao(msg):
# raise RuntimeError("Message DF must be in (4, 5, 20, 21)")
return None
c0 = util.bin2int(crc(msg, encode=True))
c0 = util.bin2int(util.crc(msg, encode=True))
c1 = util.hex2int(msg[-6:])
icao = '%06X' % (c0 ^ c1)
return icao

View File

@ -1,6 +1,4 @@
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import adsb, ehs, util
from pyModeS import adsb, ehs, util
# === Decode sample data file ===

View File

@ -1,6 +1,4 @@
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import adsb
from pyModeS import adsb
# === TEST ADS-B package ===

View File

@ -1,6 +1,4 @@
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import ehs
from pyModeS import ehs
def test_ehs_icao():

View File

@ -1,6 +1,4 @@
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/pyModeS')
import util
from pyModeS import util
def test_hex2bin():