diff --git a/data/spot.py b/data/spot.py index 56f2e78..ab7b1f4 100644 --- a/data/spot.py +++ b/data/spot.py @@ -325,6 +325,19 @@ class Spot: self.propagation_mode = mode_tag logging.info("Seen a new propagation mode tag not yet in the system: %s", mode_tag) + # Parse "de_grid -> dx_grid" structures from the comment + if self.comment: + grid_mode_grid_match = re.search( + r'\b([A-Ra-r]{2}\d{2}(?:[A-Xa-x]{2}(?:\d{2})?)?)\s*->\s*([A-Ra-r]{2}\d{2}(?:[A-Xa-x]{2}(?:\d{2})?)?)\b', + self.comment) + if grid_mode_grid_match: + # regex matches, so extract grids: + if not self.dx_grid: + self.dx_grid = grid_mode_grid_match.group(1).upper() + self.dx_location_source = "SPOT" + if not self.de_grid: + self.de_grid = grid_mode_grid_match.group(2).upper() + # DX Grid to lat/lon and vice versa in case one is missing if self.dx_grid and not self.dx_latitude: try: diff --git a/templates/add_spot.html b/templates/add_spot.html index ea5f42e..0b6d5d6 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index a4fee4b..6b13226 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 49caa9d..eb052c7 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -75,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index ac1cdb9..4cb364a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}