Finish web UI for submitting spots. Closes #29

This commit is contained in:
Ian Renton
2025-10-14 19:10:26 +01:00
parent eb424145f6
commit 67a99a6d39
7 changed files with 103 additions and 19 deletions

View File

@@ -96,10 +96,10 @@ class LookupHelper:
try:
logging.info("Downloading Clublog cty.xml...")
response = self.CLUBLOG_CTY_XML_CACHE.get("https://cdn.clublog.org/cty.php?api=" + self.CLUBLOG_API_KEY,
headers=HTTP_HEADERS).raw
with gzip.GzipFile(fileobj=response) as uncompressed:
headers=HTTP_HEADERS)
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()
with open(self.CLUBLOG_XML_DOWNLOAD_LOCATION, "wb") as f:
f.write(file_content)
f.flush()