mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2025-12-06 06:52:00 +01:00
callinfo: recognize callsigns with digits in the suffix
This commit is contained in:
parent
19f00eac5b
commit
01284a5ae8
|
|
@ -1,6 +1,14 @@
|
||||||
Changelog
|
Changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
PyHamtools 0.8.5
|
||||||
|
================
|
||||||
|
|
||||||
|
26. December 2022
|
||||||
|
|
||||||
|
* refined regex for decoding callsigns. In particular to better recognize callsigns with one or more digits in the suffix (e.g. TI5N5BEK, DP44N44T)
|
||||||
|
|
||||||
|
|
||||||
PyHamtools 0.8.4
|
PyHamtools 0.8.4
|
||||||
================
|
================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ class Callinfo(object):
|
||||||
return self._iterate_prefix(callsign, timestamp)
|
return self._iterate_prefix(callsign, timestamp)
|
||||||
|
|
||||||
# regular callsigns, without prefix or appendix
|
# regular callsigns, without prefix or appendix
|
||||||
elif re.match('^[\\d]{0,1}[A-Z]{1,2}\\d([A-Z]{1,4}|\\d{3,3}|\\d{1,3}[A-Z])[A-Z]{0,5}$', callsign):
|
elif re.match('^[\\d]{0,1}[A-Z]{1,2}\\d{1,2}[A-Z]{1,2}([A-Z]{1,4}|\\d{1,3})[A-Z]{0,5}$', callsign):
|
||||||
return self._iterate_prefix(callsign, timestamp)
|
return self._iterate_prefix(callsign, timestamp)
|
||||||
|
|
||||||
# callsigns with prefixes (xxx/callsign)
|
# callsigns with prefixes (xxx/callsign)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
VERSION = (0, 8, 4)
|
VERSION = (0, 8, 5)
|
||||||
__release__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:]
|
__release__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:]
|
||||||
__version__ = '.'.join((str(VERSION[0]), str(VERSION[1])))
|
__version__ = '.'.join((str(VERSION[0]), str(VERSION[1])))
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,24 @@ response_prefix_VK9GMW_clublog = {
|
||||||
u'longitude': 155.8
|
u'longitude': 155.8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response_prefix_8J1H90T_clublog = {
|
||||||
|
u'adif': 339,
|
||||||
|
u'continent': u'AS',
|
||||||
|
u'country': u'JAPAN',
|
||||||
|
u'cqz': 25,
|
||||||
|
u'latitude': 35.7,
|
||||||
|
u'longitude': 139.8
|
||||||
|
}
|
||||||
|
|
||||||
|
response_prefix_TI5N5BEK_clublog = {
|
||||||
|
u'adif': 308,
|
||||||
|
u'continent': u'NA',
|
||||||
|
u'country': u'COSTA RICA',
|
||||||
|
u'cqz': 7,
|
||||||
|
u'latitude': 9.9,
|
||||||
|
u'longitude': -84.0
|
||||||
|
}
|
||||||
|
|
||||||
response_callsign_exceptions_7N1PRD_0_clublog = {
|
response_callsign_exceptions_7N1PRD_0_clublog = {
|
||||||
u'adif': 339,
|
u'adif': 339,
|
||||||
u'continent': u'AS',
|
u'continent': u'AS',
|
||||||
|
|
@ -231,12 +249,15 @@ class Test_callinfo_methods:
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW/M") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DH1TW/M") == response_prefix_DH_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW/B")[const.BEACON]
|
assert fix_callinfo._dismantle_callsign("DH1TW/B")[const.BEACON]
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DH1TW") == response_prefix_DH_clublog
|
||||||
|
assert fix_callinfo._dismantle_callsign("DP44N44T") == response_prefix_DH_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("DL/HC2AO") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DL/HC2AO") == response_prefix_DH_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("9H5A/C6A") == response_prefix_C6A_clublog
|
assert fix_callinfo._dismantle_callsign("9H5A/C6A") == response_prefix_C6A_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("C6A/9H5A") == response_prefix_C6A_clublog
|
assert fix_callinfo._dismantle_callsign("C6A/9H5A") == response_prefix_C6A_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW/UNI") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DH1TW/UNI") == response_prefix_DH_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW/BUX") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DH1TW/BUX") == response_prefix_DH_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("DH1TW/NOT") == response_prefix_DH_clublog
|
assert fix_callinfo._dismantle_callsign("DH1TW/NOT") == response_prefix_DH_clublog
|
||||||
|
assert fix_callinfo._dismantle_callsign("8J1H90T") == response_prefix_8J1H90T_clublog
|
||||||
|
assert fix_callinfo._dismantle_callsign("TI5N5BEK") == response_prefix_TI5N5BEK_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("VK9DLX/NOT") == response_prefix_VK9DLX_clublog
|
assert fix_callinfo._dismantle_callsign("VK9DLX/NOT") == response_prefix_VK9DLX_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("7QAA") == response_callsign_exceptions_7QAA_clublog
|
assert fix_callinfo._dismantle_callsign("7QAA") == response_callsign_exceptions_7QAA_clublog
|
||||||
assert fix_callinfo._dismantle_callsign("7N1PRD/0") == response_callsign_exceptions_7N1PRD_0_clublog
|
assert fix_callinfo._dismantle_callsign("7N1PRD/0") == response_callsign_exceptions_7N1PRD_0_clublog
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue