diff --git a/data/spot.py b/data/spot.py index 0a56eb2..ed2ad1f 100644 --- a/data/spot.py +++ b/data/spot.py @@ -288,6 +288,19 @@ class Spot: if self.sig_refs and len(self.sig_refs) > 0 and not self.sig: self.sig = self.sig_refs[0].sig + # Parse "de_griddx_grid" structures from the comment, e.g. "JN61ESJM56XT" or "JO02GQ<>KN17LG". These + # are common on cluster spots and can provide grid references in preference to e.g. QRZ lookup. + if self.comment: + grid_pair_match = re.search( + r'\b([A-Ra-r]{2}\d{2}(?:[A-Xa-x]{2}(?:\d{2})?)?)<[^>]*>([A-Ra-r]{2}\d{2}(?:[A-Xa-x]{2}(?:\d{2})?)?)\b', + self.comment) + if grid_pair_match: + if not self.de_grid: + self.de_grid = grid_pair_match.group(1).upper() + if not self.dx_grid: + self.dx_grid = grid_pair_match.group(2).upper() + self.dx_location_source = "SPOT" + # 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 fe45022..966ec3d 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 2bd130b..384598a 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index f6046fd..178145c 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 505cc47..361d970 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 %}
diff --git a/templates/conditions.html b/templates/conditions.html index 3f7b2cf..835522e 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index df82e1f..7948b9f 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 4f67e84..09330bd 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index f1cec89..6cd615c 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - +