mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 14:57: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
|
||||
from typing import Any
|
||||
|
||||
@@ -6,6 +8,7 @@ from tornado import httputil
|
||||
from tornado.web import Application
|
||||
|
||||
from core.utils import safe_json_dumps
|
||||
from data.solar_conditions import SolarConditions
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -15,17 +18,17 @@ class APISolarConditionsHandler(tornado.web.RequestHandler):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
application: "Application",
|
||||
application: Application,
|
||||
request: httputil.HTTPServerRequest,
|
||||
**kwargs: Any,
|
||||
):
|
||||
self._solar_conditions = None
|
||||
) -> None:
|
||||
self._solar_conditions: SolarConditions | None = None
|
||||
super().__init__(application, request, **kwargs)
|
||||
|
||||
def initialize(self, solar_conditions):
|
||||
def initialize(self, solar_conditions: SolarConditions) -> None:
|
||||
self._solar_conditions = solar_conditions
|
||||
|
||||
def get(self):
|
||||
def get(self) -> None:
|
||||
try:
|
||||
self.write(self._solar_conditions.to_json())
|
||||
self.set_status(200)
|
||||
|
||||
Reference in New Issue
Block a user