Type hint additions (#26765)

This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2019-09-20 08:23:34 -07:00
1 parent 6a3132344c
commit 54242cd65c
10 files changed
+60 -52

No files matched your search

@@ -4,6 +4,7 @@ import logging
import mimetypes
import os
import pathlib
from typing import Optional, Set, Tuple
from aiohttp import web, web_urldispatcher, hdrs
import voluptuous as vol
@@ -22,7 +23,7 @@ from homeassistant.loader import bind_hass
from .storage import async_setup_frontend_storage
# mypy: allow-incomplete-defs, allow-untyped-defs, no-check-untyped-defs
# mypy: allow-untyped-defs, no-check-untyped-defs
# Fix mimetypes for borked Windows machines
# https://github.com/home-assistant/home-assistant-polymer/issues/3336
@@ -400,7 +401,9 @@ class IndexView(web_urldispatcher.AbstractResource):
"""Construct url for resource with additional params."""
return URL("/")
async def resolve(self, request: web.Request):
async def resolve(
self, request: web.Request
) -> Tuple[Optional[web_urldispatcher.UrlMappingMatchInfo], Set[str]]:
"""Resolve resource.
Return (UrlMappingMatchInfo, allowed_methods) pair.
@@ -447,7 +450,7 @@ class IndexView(web_urldispatcher.AbstractResource):
return tpl
async def get(self, request: web.Request):
async def get(self, request: web.Request) -> web.Response:
"""Serve the index page for panel pages."""
hass = request.app["hass"]