chore: add type hints

This commit is contained in:
2023-07-19 04:10:42 -03:00
parent e36e1f73c5
commit 7c5c92f27a
3 changed files with 5 additions and 3 deletions

View File

@@ -18,7 +18,8 @@ class HttpClient:
logger.debug(f"Request: {url} Status: {resp.status}") logger.debug(f"Request: {url} Status: {resp.status}")
if resp.status != 200: if resp.status != 200:
raise RequestException( raise RequestException(
f"Request to url {url} with method {method} failed with status code {resp.status}." f"Request to url {url} with method {method} failed "
" with status code {resp.status}."
) )
return await resp.text() return await resp.text()

View File

@@ -37,7 +37,7 @@ class AttendencyPage:
def history(self) -> AttendencyHistory: def history(self) -> AttendencyHistory:
return self._history return self._history
def is_available(self): def is_available(self) -> bool:
return self._available return self._available
async def confirm(self) -> None: async def confirm(self) -> None:

View File

@@ -1,9 +1,10 @@
from typing import Any
from functools import wraps from functools import wraps
def is_logged_check(method): def is_logged_check(method):
@wraps(method) @wraps(method)
def wrapper(self, *args, **kwargs): def wrapper(self, *args: Any, **kwargs: Any) -> Any:
if not self.is_logged: if not self.is_logged:
raise Exception("You must be logged in to use this method") raise Exception("You must be logged in to use this method")
return method(self, *args, **kwargs) return method(self, *args, **kwargs)