mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import csv
|
||||
from time import sleep
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
|
||||
from core.enums import ActivityName, ActivityRefType
|
||||
from data.activity_ref import ActivityRef
|
||||
@@ -15,11 +20,11 @@ class GMA(FileDownloadActivityRefDataProvider):
|
||||
ACTIVITY = ActivityName.GMA
|
||||
DATA_URL = "https://www.gma.rocks/download/summits.csv"
|
||||
|
||||
def __init__(self, provider_config):
|
||||
def __init__(self, provider_config: dict[str, Any]) -> None:
|
||||
super().__init__(self.ACTIVITY, provider_config, self.DATA_URL, self.POLL_INTERVAL_DAYS)
|
||||
|
||||
def _http_response_to_data(self, http_response):
|
||||
new_data = []
|
||||
def _http_response_to_data(self, http_response: requests.Response) -> list[ActivityRef]:
|
||||
new_data: list[ActivityRef] = []
|
||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()[1:]):
|
||||
ref_id = row["Reference"]
|
||||
new_data.append(
|
||||
|
||||
Reference in New Issue
Block a user