mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 16:59:25 +00:00
Extract SIG and SIG_INFO from cluster spots. Closes #47
This commit is contained in:
14
core/utils.py
Normal file
14
core/utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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"
|
||||
|
||||
# Regex matching any SIG
|
||||
ANY_SIG_REGEX = r"(" + r"|".join(list(map(lambda p: p.name, SIGS))) + r")"
|
||||
|
||||
# Regex matching any SIG reference
|
||||
ANY_SIG_REF_REGEX = r"[\w\/]+\-\d+"
|
||||
Reference in New Issue
Block a user