mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2025-12-06 06:52:00 +01:00
replaced regex with simple manipulation
This commit is contained in:
parent
0ff3b43688
commit
195d437f8e
|
|
@ -96,26 +96,18 @@ class Callinfo(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_if_mm(callsign):
|
def check_if_mm(callsign):
|
||||||
if re.search("/MM$", callsign.upper()):
|
check = callsign[-3:].upper()
|
||||||
return True
|
return "/MM" in check
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_if_am(callsign):
|
def check_if_am(callsign):
|
||||||
if re.search("/AM$", callsign.upper()):
|
check = callsign[-3:].upper()
|
||||||
return True
|
return "/AM" in check
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_if_beacon(callsign):
|
def check_if_beacon(callsign):
|
||||||
if re.search("/B$", callsign.upper()):
|
check = callsign[-4:].upper()
|
||||||
return True
|
return "/B" in check or "/BCN" in check
|
||||||
elif re.search("/BCN$", callsign.upper()):
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def _dismantle_callsign(self, callsign, timestamp=timestamp_now):
|
def _dismantle_callsign(self, callsign, timestamp=timestamp_now):
|
||||||
""" try to identify the callsign's identity by analyzing it in the following order:
|
""" try to identify the callsign's identity by analyzing it in the following order:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue