From f28bcc246484fd8b2fccd30e7ed294c006884a51 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 21 Jun 2026 22:18:20 +0100 Subject: [PATCH 1/7] Allow standard parentheses for DX cluster "de_griddx_grid" structures --- data/spot.py | 12 ++++++------ templates/add_spot.html | 2 +- templates/alerts.html | 2 +- templates/bands.html | 4 ++-- templates/base.html | 10 +++++----- templates/conditions.html | 2 +- templates/map.html | 4 ++-- templates/spots.html | 4 ++-- templates/status.html | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/data/spot.py b/data/spot.py index 6da7007..3cb61a4 100644 --- a/data/spot.py +++ b/data/spot.py @@ -290,23 +290,23 @@ 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". + # Parse "de_griddx_grid" structures from the comment, e.g. "JN61ES(ES)JM56XT" or "JO02GQ<>KN17LG". # These are common on cluster spots and can provide grid references in preference to e.g. QRZ lookup, as well as - # being the only source we have for propagation mode. + # being the only source we have for propagation mode. Brace for nightmare regex from hell. if self.comment: grid_mode_grid_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', + 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_mode_grid_match: # regex matches, so extract grids: if not self.de_grid: self.de_grid = grid_mode_grid_match.group(1).upper() if not self.dx_grid: - self.dx_grid = grid_mode_grid_match.group(3).upper() + self.dx_grid = grid_mode_grid_match.group(4).upper() self.dx_location_source = "SPOT" - # And extract propagation mode: - mode_tag = grid_mode_grid_match.group(2).upper() + # And extract propagation mode (group 2 for <...>, group 3 for (...)): + mode_tag = (grid_mode_grid_match.group(2) or grid_mode_grid_match.group(3) or "").upper() if mode_tag and not self.propagation_mode: if mode_tag in PROPAGATION_MODES: self.propagation_mode = PROPAGATION_MODES[mode_tag] diff --git a/templates/add_spot.html b/templates/add_spot.html index 380afec..64c40c0 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 fef1ee6..1296cbc 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 50fce7a..f11fdbb 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 36341da..b58377f 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 dbcdf49..05a15d2 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index ca953b5..72df066 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index df3a546..f0b1b98 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 9472818..78a4136 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - + + diff --git a/templates/alerts.html b/templates/alerts.html index 1296cbc..3e1342c 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index f11fdbb..7a8b837 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index b58377f..5b29023 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 05a15d2..0716f4f 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 72df066..2cba44b 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index f0b1b98..82ed7c3 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 78a4136..2c3f3de 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - + + diff --git a/templates/alerts.html b/templates/alerts.html index 3e1342c..a371b91 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 7a8b837..9bb647c 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 5b29023..f756d70 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 0716f4f..e2926bb 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 2cba44b..6621de2 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 82ed7c3..c4d1c3e 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 2c3f3de..d33d329 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - + + diff --git a/templates/alerts.html b/templates/alerts.html index a371b91..7d3f4ad 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 9bb647c..d81d170 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index f756d70..b044ec7 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 e2926bb..bc36299 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 6621de2..b5ddee4 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index c4d1c3e..933c1a5 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index d33d329..6ed1759 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - + + diff --git a/templates/alerts.html b/templates/alerts.html index 7d3f4ad..f3720ca 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index d81d170..758c822 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index b044ec7..375148b 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 bc36299..3aea838 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index b5ddee4..a21d7bf 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 933c1a5..4b26010 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 6ed1759..3e8cfd9 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - +