Replace dash-separated config & API properties with underscore-separated versions. #127

This commit is contained in:
Ian Renton
2026-08-10 20:55:18 +01:00
parent 5c86346074
commit c687202a61
54 changed files with 247 additions and 246 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ class GMA(HTTPSpotProvider):
def __init__(self, provider_config):
# Ensure there is an API key in our config, and set up the query URL using it. If no key is provided,
# disable this spot provider.
self._api_key = provider_config.get("api-key", "")
self._api_key = provider_config.get("api_key", "")
if self._api_key == "":
provider_config["enabled"] = False
logging.warning("GMA spot provider configured but no api key was provided, this API will not be queried.")
@@ -68,7 +68,7 @@ class GMA(HTTPSpotProvider):
ref_response = self._url_data_cache.get(self.REF_INFO_URL_ROOT + source_spot["REF"],
headers=HTTP_HEADERS)
# Sometimes this is blank even if it's a 200 response, so handle that
if ref_response.ok and ref_response.text is not None and ref_response.text != "":
if ref_response.ok and ref_response.text is not None and ref_response.text != "" and ref_response.text != "\n":
ref_info = ref_response.json()
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. POTA and WWFF
# spots come through with reftype=POTA or reftype=WWFF. SOTA is harder to figure out because both SOTA
@@ -116,7 +116,7 @@ class GMA(HTTPSpotProvider):
f"GMA API returned a malformed response when looking up ref {source_spot["REF"]}")
except:
logging.warning("Exception when looking up " + self.REF_INFO_URL_ROOT + source_spot[
"REF"] + ", ignoring this spot for now")
"REF"] + ", ignoring this spot for now", exc_info=True)
else:
logging.warning(f"The GMA API returned an unexpected response (HTTP {http_response.status_code}).")