Infer location from WAB/WAI grid. Closes #62

This commit is contained in:
Ian Renton
2025-10-20 16:07:33 +01:00
parent e2e5eb0b8b
commit 15c216c5e0
19 changed files with 140 additions and 26 deletions

21
core/sig_utils.py Normal file
View File

@@ -0,0 +1,21 @@
from core.constants import SIGS
# Utility function to get the icon for a named SIG. If no match is found, the "circle-question" icon will be returned.
def get_icon_for_sig(sig):
for s in SIGS:
if s.name == sig:
return s.icon
return "circle-question"
# Utility function to get the regex string for a SIG reference for a named SIG. If no match is found, None will be returned.
def get_ref_regex_for_sig(sig):
for s in SIGS:
if s.name == sig:
return s.ref_regex
return None
# Regex matching any SIG
ANY_SIG_REGEX = r"(" + r"|".join(list(map(lambda p: p.name, SIGS))) + r")"
# Regex matching any SIG reference
ANY_XOTA_SIG_REF_REGEX = r"[\w\/]+\-\d+"