Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:02:19 +01:00
parent 6037e742cc
commit 324dd1414b
132 changed files with 1228 additions and 706 deletions
+6 -3
View File
@@ -1,8 +1,11 @@
from __future__ import annotations
import re
from datetime import datetime
from typing import cast
from typing import Any, cast
import pytz
import requests
from rss_parser import Parser
from rss_parser.models.rss import RSS
@@ -18,10 +21,10 @@ class NG3K(HTTPAlertProvider):
ALERTS_URL = "https://www.ng3k.com/adxo.xml"
AS_CALL_PATTERN = re.compile("as ([a-z0-9/]+)", re.IGNORECASE)
def __init__(self, provider_config):
def __init__(self, provider_config: dict[str, Any]) -> None:
super().__init__("NG3K", provider_config, self.ALERTS_URL, self.POLL_INTERVAL_DAYS * 24 * 60 * 60)
def _http_response_to_alerts(self, http_response):
def _http_response_to_alerts(self, http_response: requests.Response) -> list[Alert]:
new_alerts = []
rss = cast(RSS, Parser.parse(http_response.content.decode("utf-8-sig")))
# Iterate through source data