Allow some SIG refs to be picked up from comments without separate SIG name. Closes #134

This commit is contained in:
Ian Renton
2026-08-31 20:49:15 +01:00
parent e4738b2c7d
commit 892827f1f8
15 changed files with 111 additions and 49 deletions
+5 -3
View File
@@ -37,9 +37,11 @@ class FEA(FileDownloadSIGRefDataProvider):
for row in all_rows:
if not "REF" in row[0] and not "\n" in row[0]:
# FEA references are technically [DE]\-\d{4}(\.\d)? but spotters always seem to miss out the D- or E-
# prefix and just use FEA 1234, so we treat FEA reference IDs as if they were just the number.
ref_id = row[0].strip().replace("D-", "").replace("E-", "")
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row[1].strip(), ref_type="Lighthouse"))
# prefix and just use FEA-1234 or FEA 1234, so we add both copies to the database.
ref_id_1 = row[0].strip()
ref_id_2 = ref_id_1.replace("D-", "FEA-").replace("E-", "FEA-")
new_data.append(SIGRef(sig=self.SIG, id=ref_id_1, name=row[1].strip(), ref_type="Lighthouse"))
new_data.append(SIGRef(sig=self.SIG, id=ref_id_2, name=row[1].strip(), ref_type="Lighthouse"))
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
# the data in this case