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
+5 -3
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import logging
import tornado
@@ -20,7 +22,7 @@ class V1RedirectHandler(tornado.web.RequestHandler):
"""Transparently proxies requests from the old API to the new one,
returning whatever the v2 endpoint returns, for endpoints with no breaking changes."""
async def _proxy(self, path):
async def _proxy(self, path: str) -> None:
new_url = f"{self.request.protocol}://{self.request.host}/api/v2/{path}"
if self.request.query:
new_url += f"?{self.request.query}"
@@ -61,8 +63,8 @@ class V1RedirectHandler(tornado.web.RequestHandler):
if response.body:
self.write(response.body)
async def get(self, path):
async def get(self, path: str) -> None:
await self._proxy(path)
async def post(self, path):
async def post(self, path: str) -> None:
await self._proxy(path)