mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Add support for FEA
This commit is contained in:
@@ -246,6 +246,9 @@ sig_ref_data_providers:
|
|||||||
- class: "DME"
|
- class: "DME"
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- class: "FEA"
|
||||||
|
enabled: true
|
||||||
|
|
||||||
- class: "KRMNPA"
|
- class: "KRMNPA"
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -147,9 +147,15 @@ SIGS = [
|
|||||||
SIG(
|
SIG(
|
||||||
name="DME",
|
name="DME",
|
||||||
comment_names=["DME"],
|
comment_names=["DME"],
|
||||||
description="Diplomas de Municipios Españoles",
|
description="Diploma Municipios de España",
|
||||||
ref_regex=r"\d{4,5}",
|
ref_regex=r"\d{4,5}",
|
||||||
),
|
),
|
||||||
|
SIG(
|
||||||
|
name="FEA",
|
||||||
|
comment_names=["FEA"],
|
||||||
|
description="Diploma Faros de España",
|
||||||
|
ref_regex=r"([DE]|FEA)\-\d{4}(\.\d)?",
|
||||||
|
),
|
||||||
SIG(
|
SIG(
|
||||||
name="DTMBA",
|
name="DTMBA",
|
||||||
comment_names=["DTMBA"],
|
comment_names=["DTMBA"],
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
from io import BytesIO
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
import pdfplumber
|
||||||
|
|
||||||
|
from data.sig_ref import SIGRef
|
||||||
|
from providers.sigrefdata.file_download_sig_ref_data_provider import FileDownloadSIGRefDataProvider
|
||||||
|
|
||||||
|
|
||||||
|
class FEA(FileDownloadSIGRefDataProvider):
|
||||||
|
"""SIG ref data provider for Diploma Faros de España"""
|
||||||
|
|
||||||
|
POLL_INTERVAL_DAYS = 30
|
||||||
|
SIG = "FEA"
|
||||||
|
DATA_URL = "http://ea5ol.net/Lista%20Faros.pdf"
|
||||||
|
|
||||||
|
def __init__(self, provider_config):
|
||||||
|
super().__init__(self.SIG, provider_config, self.DATA_URL, self.POLL_INTERVAL_DAYS)
|
||||||
|
|
||||||
|
def _http_response_to_data(self, http_response):
|
||||||
|
new_data = []
|
||||||
|
|
||||||
|
# Use PDFPlumber to extract the tables in the PDF
|
||||||
|
with pdfplumber.open(BytesIO(http_response.content)) as pdf:
|
||||||
|
all_rows = []
|
||||||
|
|
||||||
|
for page_number, page in enumerate(pdf.pages, start=1):
|
||||||
|
tables = page.extract_tables()
|
||||||
|
|
||||||
|
for table_number, table in enumerate(tables, start=1):
|
||||||
|
if not table:
|
||||||
|
continue
|
||||||
|
|
||||||
|
rows = [row for row in table if any(cell and cell.strip() for cell in row)]
|
||||||
|
all_rows.extend(rows)
|
||||||
|
|
||||||
|
for row in all_rows:
|
||||||
|
if not "REF" in row[0] and not "\n" in row[0]:
|
||||||
|
new_data.append(SIGRef(sig=self.SIG, id=row[0].strip(), name=row[1].strip(), ref_type="Lighthouse"))
|
||||||
|
|
||||||
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
|
||||||
|
# the data in this case
|
||||||
|
if self._stop_event.is_set():
|
||||||
|
break
|
||||||
|
|
||||||
|
# Very short pause. This will extend the time to handle sig refs by a few seconds but will ensure some time
|
||||||
|
# is available for other threads e.g. the web server.
|
||||||
|
sleep(0.001)
|
||||||
|
|
||||||
|
return new_data
|
||||||
+2
-1
@@ -20,4 +20,5 @@ geopandas~=0.13.2
|
|||||||
simplejson~=4.1.1
|
simplejson~=4.1.1
|
||||||
cachetools~=7.1.6
|
cachetools~=7.1.6
|
||||||
fastkml~=1.4.0
|
fastkml~=1.4.0
|
||||||
ruff~=0.16.3
|
ruff~=0.16.3
|
||||||
|
pdfplumber~=0.11.10
|
||||||
@@ -852,6 +852,7 @@ components:
|
|||||||
- WAB
|
- WAB
|
||||||
- WAI
|
- WAI
|
||||||
- DME
|
- DME
|
||||||
|
- FEA
|
||||||
- DTMBA
|
- DTMBA
|
||||||
- Toilets
|
- Toilets
|
||||||
example: POTA
|
example: POTA
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ const SIG_ICONS = {
|
|||||||
"WAB": "fa-table-cells-large",
|
"WAB": "fa-table-cells-large",
|
||||||
"WAI": "fa-table-cells-large",
|
"WAI": "fa-table-cells-large",
|
||||||
"DME": "fa-building",
|
"DME": "fa-building",
|
||||||
|
"FEA": "fa-house-flood-water",
|
||||||
"Tiles": "fa-square",
|
"Tiles": "fa-square",
|
||||||
"DTMBA": "fa-masks-theater",
|
"DTMBA": "fa-masks-theater",
|
||||||
"Toilets": "fa-toilet"
|
"Toilets": "fa-toilet"
|
||||||
@@ -392,6 +393,8 @@ const SIG_NAMES = {
|
|||||||
"WWTOTA": "Towers on the Air",
|
"WWTOTA": "Towers on the Air",
|
||||||
"WAB": "Worked All Britain",
|
"WAB": "Worked All Britain",
|
||||||
"WAI": "Worked All Ireland",
|
"WAI": "Worked All Ireland",
|
||||||
|
"DME": "Diploma Municipios de España",
|
||||||
|
"FEA": "Diploma Faros de España",
|
||||||
"Tiles": "Tiles on the Air",
|
"Tiles": "Tiles on the Air",
|
||||||
"DTMBA": "Diploma Teatri Musei e Belle Arti",
|
"DTMBA": "Diploma Teatri Musei e Belle Arti",
|
||||||
"TOTA": "Toilets on the Air"
|
"TOTA": "Toilets on the Air"
|
||||||
|
|||||||
@@ -102,8 +102,8 @@
|
|||||||
on the Air (SIOTA), World Castles Award (WCA), New Zealand on the Air (ZLOTA), Keith Roget Memorial National
|
on the Air (SIOTA), World Castles Award (WCA), New Zealand on the Air (ZLOTA), Keith Roget Memorial National
|
||||||
Parks Award (KRMNPA), South Australia National Parks and Conservation Parks Award (SANPCPA), Wainwrights on the
|
Parks Award (KRMNPA), South Australia National Parks and Conservation Parks Award (SANPCPA), Wainwrights on the
|
||||||
Air (WOTA), Beaches on the Air (BOTA), Lagos y Lagunas On the Air (LLOTA), Towers on the Air, Tiles on
|
Air (WOTA), Beaches on the Air (BOTA), Lagos y Lagunas On the Air (LLOTA), Towers on the Air, Tiles on
|
||||||
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), el Diploma Municipios de España (DME), Diploma
|
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), el Diploma Municipios de España (DME), el Diploma
|
||||||
Teatri Musei e Belle Arti (DTMBA) and Toilets on the Air.</p>
|
Faros de España (FEA), il Diploma Teatri Musei e Belle Arti (DTMBA) and Toilets on the Air.</p>
|
||||||
<p>As of the time of writing in June 2026, I think Spothole captures essentially all outdoor radio programmes
|
<p>As of the time of writing in June 2026, I think Spothole captures essentially all outdoor radio programmes
|
||||||
that have a defined reference list, and almost certainly those that have a spotting/alerting API. If you know of
|
that have a defined reference list, and almost certainly those that have a spotting/alerting API. If you know of
|
||||||
one I've missed, please let me know!</p>
|
one I've missed, please let me know!</p>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/add-spot.js?v=1788163223"></script>
|
<script src="/static/js/add-spot.js?v=1788165546"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-add-spot").addClass("active");
|
$("#nav-link-add-spot").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/alerts.js?v=1788163223"></script>
|
<script src="/static/js/alerts.js?v=1788165546"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-alerts").addClass("active");
|
$("#nav-link-alerts").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1788165546"></script>
|
||||||
<script src="/static/js/bands.js?v=1788163223"></script>
|
<script src="/static/js/bands.js?v=1788165546"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-bands").addClass("active");
|
$("#nav-link-bands").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{% extends "skeleton.html" %}
|
{% extends "skeleton.html" %}
|
||||||
{% block head_extra %}
|
{% block head_extra %}
|
||||||
<link rel="stylesheet" href="/static/css/style.css?v=1788163223" type="text/css">
|
<link rel="stylesheet" href="/static/css/style.css?v=1788165546" type="text/css">
|
||||||
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
window.fetchEventSource = fetchEventSource;
|
window.fetchEventSource = fetchEventSource;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/static/js/utils.js?v=1788163223"></script>
|
<script src="/static/js/utils.js?v=1788165546"></script>
|
||||||
<script src="/static/js/ui-ham.js?v=1788163223"></script>
|
<script src="/static/js/ui-ham.js?v=1788165546"></script>
|
||||||
<script src="/static/js/geo.js?v=1788163223"></script>
|
<script src="/static/js/geo.js?v=1788165546"></script>
|
||||||
<script src="/static/js/common.js?v=1788163223"></script>
|
<script src="/static/js/common.js?v=1788165546"></script>
|
||||||
{% end %}
|
{% end %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
||||||
<script src="/static/js/conditions.js?v=1788163223"></script>
|
<script src="/static/js/conditions.js?v=1788165546"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-conditions").addClass("active");
|
$("#nav-link-conditions").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+2
-2
@@ -113,8 +113,8 @@
|
|||||||
const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}";
|
const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1788165545"></script>
|
||||||
<script src="/static/js/map.js?v=1788163223"></script>
|
<script src="/static/js/map.js?v=1788165545"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-map").addClass("active");
|
$("#nav-link-map").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -113,8 +113,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1788165545"></script>
|
||||||
<script src="/static/js/spots.js?v=1788163223"></script>
|
<script src="/static/js/spots.js?v=1788165545"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-spots").addClass("active");
|
$("#nav-link-spots").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/status.js?v=1788163223"></script>
|
<script src="/static/js/status.js?v=1788165546"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#nav-link-status").addClass("active");
|
$("#nav-link-status").addClass("active");
|
||||||
|
|||||||
Reference in New Issue
Block a user