Merge branch 'dev', v0.6.33
ef531ca- bump to v0.6.33fdc69ac- renamed reloading variables9b79261- added ambiguity parsing for normal packets
This commit is contained in:
commit
df25f65d88
5
CHANGES
5
CHANGES
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue