mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-24 13:45:11 +00:00
IDE inspection fixes and global autoformat
This commit is contained in:
@@ -14,7 +14,8 @@ class Tiles(HTTPSpotProvider):
|
||||
POLL_INTERVAL_SEC = 120
|
||||
SPOTS_URL = "https://icneuzxitdqtofutxbla.supabase.co/functions/v1/spots?active_hours=24"
|
||||
SUBMIT_URL = "https://icneuzxitdqtofutxbla.supabase.co/functions/v1/self-spot"
|
||||
VALID_MODES = ["SSB", "CW", "FT8", "FT4", "FM", "DMR", "D-STAR", "M17", "AX.25", "JS8Call", "PSK31", "Olivia", "VarAC", "Other"]
|
||||
VALID_MODES = ["SSB", "CW", "FT8", "FT4", "FM", "DMR", "D-STAR", "M17", "AX.25", "JS8Call", "PSK31", "Olivia",
|
||||
"VarAC", "Other"]
|
||||
|
||||
def __init__(self, provider_config):
|
||||
super().__init__(provider_config, self.SPOTS_URL, self.POLL_INTERVAL_SEC)
|
||||
@@ -82,11 +83,13 @@ class Tiles(HTTPSpotProvider):
|
||||
headers = {**HTTP_HEADERS, "Content-Type": "application/json"}
|
||||
response = requests.post(self.SUBMIT_URL, json=body, headers=headers, timeout=(5, 30))
|
||||
if not response.ok:
|
||||
raise RuntimeError("Tiles on the Air API returned " + str(response.status_code) + ": " + response.text)
|
||||
raise RuntimeError(
|
||||
"Tiles on the Air API returned " + str(response.status_code) + ": " + response.text)
|
||||
else:
|
||||
raise RuntimeError("The Tiles on the Air API requires a mode to be set.")
|
||||
else:
|
||||
raise RuntimeError("The Tiles on the Air API only supports self-spots, the DX call and spotter call must match.")
|
||||
raise RuntimeError(
|
||||
"The Tiles on the Air API only supports self-spots, the DX call and spotter call must match.")
|
||||
|
||||
|
||||
# Utility function to keep the first decimal point in a given string but remove any others. Used to parse Tiles'
|
||||
|
||||
Reference in New Issue
Block a user