mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 06:47:42 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import Any
|
||||
@@ -9,6 +11,7 @@ from tornado.web import Application
|
||||
from core.activity_utils import get_ref_regex_for_activity
|
||||
from core.config import ALLOW_SPOTTING
|
||||
from core.constants import UNKNOWN_BAND
|
||||
from core.live_data_cache import LiveDataCache
|
||||
from core.utils import infer_band_from_freq, safe_json_dumps
|
||||
from data.spot import Spot
|
||||
|
||||
@@ -20,17 +23,17 @@ class V1APISpotHandler(tornado.web.RequestHandler):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
application: "Application",
|
||||
application: Application,
|
||||
request: httputil.HTTPServerRequest,
|
||||
**kwargs: Any,
|
||||
):
|
||||
self._spots = None
|
||||
) -> None:
|
||||
self._spots: LiveDataCache | None = None
|
||||
super().__init__(application, request, **kwargs)
|
||||
|
||||
def initialize(self, spots):
|
||||
def initialize(self, spots: LiveDataCache) -> None:
|
||||
self._spots = spots
|
||||
|
||||
def post(self):
|
||||
def post(self) -> None:
|
||||
try:
|
||||
# Reject if not allowed
|
||||
if not ALLOW_SPOTTING:
|
||||
|
||||
Reference in New Issue
Block a user