mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 01:04:33 +00:00
WWTOTA cluster support #97
This commit is contained in:
@@ -4,7 +4,7 @@ from data.sig import SIG
|
||||
|
||||
# General software
|
||||
SOFTWARE_NAME = "Spothole by M0TRT"
|
||||
SOFTWARE_VERSION = "1.2"
|
||||
SOFTWARE_VERSION = "1.3-pre"
|
||||
|
||||
# HTTP headers used for spot providers that use HTTP
|
||||
HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + ", v" + SOFTWARE_VERSION + " (operated by " + SERVER_OWNER_CALLSIGN + ")"}
|
||||
|
||||
@@ -140,12 +140,14 @@ class LookupHelper:
|
||||
# database live if possible.
|
||||
def download_clublog_ctyxml(self):
|
||||
try:
|
||||
logging.info("Downloading Clublog cty.xml...")
|
||||
logging.info("Downloading Clublog cty.xml.gz...")
|
||||
response = self.CLUBLOG_CTY_XML_CACHE.get("https://cdn.clublog.org/cty.php?api=" + self.CLUBLOG_API_KEY,
|
||||
headers=HTTP_HEADERS)
|
||||
logging.info("Caching Clublog cty.xml.gz...")
|
||||
open(self.CLUBLOG_XML_DOWNLOAD_LOCATION + ".gz", 'wb').write(response.content)
|
||||
with gzip.open(self.CLUBLOG_XML_DOWNLOAD_LOCATION + ".gz", "rb") as uncompressed:
|
||||
file_content = uncompressed.read()
|
||||
logging.info("Caching Clublog cty.xml...")
|
||||
with open(self.CLUBLOG_XML_DOWNLOAD_LOCATION, "wb") as f:
|
||||
f.write(file_content)
|
||||
f.flush()
|
||||
|
||||
@@ -135,6 +135,10 @@ def populate_sig_ref_info(sig_ref):
|
||||
sig_ref.latitude = ll[0]
|
||||
sig_ref.longitude = ll[1]
|
||||
break
|
||||
elif sig.upper() == "WWTOTA":
|
||||
if not sig_ref.name:
|
||||
sig_ref.name = sig_ref.id
|
||||
sig_ref.url = "https://wwtota.com/seznam/karta_rozhledny.php?ref=" + sig_ref.name
|
||||
elif sig.upper() == "WAB" or sig.upper() == "WAI":
|
||||
ll = wab_wai_square_to_lat_lon(ref_id)
|
||||
if ll:
|
||||
|
||||
Reference in New Issue
Block a user