Merge branch 'dev', v0.6.33

ef531ca - bump to v0.6.33
fdc69ac - renamed reloading variables
9b79261 - added ambiguity parsing for normal packets
This commit is contained in:
Rossen Georgiev 2015-01-02 14:15:55 +00:00
commit df25f65d88
3 changed files with 24 additions and 7 deletions

View File

@ -1,6 +1,11 @@
CHANGES
-------
# v0.6.33
- added ambiguity parsing for normal position reports
(fixes the unexpected exception)
# v0.6.32
- sendall() method to IS, allows sending of packets

View File

@ -25,16 +25,19 @@ Currently the library provides facilities to:
# handles reloading
if 'IS' in globals():
modules = __import__('sys').modules
for m in modules.keys():
if m[:len(__name__)+1] == "%s." % __name__:
del modules[m]
MODULES = __import__('sys').modules
for M in MODULES.keys():
if M[:len(__name__)+1] == "%s." % __name__:
del MODULES[M]
del MODULES
del M
from datetime import date as _date
__date__ = str(_date.today())
del _date
__version__ = "0.6.32"
__version__ = "0.6.33"
__author__ = "Rossen Georgiev"
__all__ = ['IS', 'parse', 'passcode']

View File

@ -818,7 +818,17 @@ def _parse_normal(body):
body
) = match[0]
# TODO: position ambiguity
# position ambiguity
posambiguity = lat_min.count(' ')
parsed.update({'posambiguity': posambiguity})
# we center the position inside the ambiguity box
if posambiguity >= 4:
lat_min = "30"
lon_min = "30"
else:
lat_min = lat_min.replace(' ', '5', 1)
lon_min = lon_min.replace(' ', '5', 1)
# validate longitude and latitude
@ -839,7 +849,6 @@ def _parse_normal(body):
"""
# convert coordinates from DDMM.MM to decimal
latitude = int(lat_deg) + (float(lat_min) / 60.0)
longitude = int(lon_deg) + (float(lon_min) / 60.0)