fix "R" callsign problem

This commit is contained in:
Jakob Ketterl 2020-12-08 00:01:00 +01:00
parent 603c3df1b6
commit 519155a12f
1 changed files with 3 additions and 3 deletions

View File

@ -187,7 +187,7 @@ class WsjtParser(Parser):
class Decoder(ABC):
locator_pattern = re.compile(".*\\s([A-Z0-9]+)\\s([A-R]{2}[0-9]{2})$")
locator_pattern = re.compile(".*\\s([A-Z0-9]{2,})(\\sR)?\\s([A-R]{2}[0-9]{2})$")
def parse_timestamp(self, instring, dateformat):
ts = datetime.strptime(instring, dateformat)
@ -205,9 +205,9 @@ class Decoder(ABC):
return {}
# this is a valid locator in theory, but it's somewhere in the arctic ocean, near the north pole, so it's very
# likely this just means roger roger goodbye.
if m.group(2) == "RR73":
if m.group(3) == "RR73":
return {"callsign": m.group(1)}
return {"callsign": m.group(1), "locator": m.group(2)}
return {"callsign": m.group(1), "locator": m.group(3)}
class Jt9Decoder(Decoder):