chore: add type hints
This commit is contained in:
@@ -18,7 +18,8 @@ class HttpClient:
|
||||
logger.debug(f"Request: {url} Status: {resp.status}")
|
||||
if resp.status != 200:
|
||||
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()
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class AttendencyPage:
|
||||
def history(self) -> AttendencyHistory:
|
||||
return self._history
|
||||
|
||||
def is_available(self):
|
||||
def is_available(self) -> bool:
|
||||
return self._available
|
||||
|
||||
async def confirm(self) -> None:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from typing import Any
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def is_logged_check(method):
|
||||
@wraps(method)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
def wrapper(self, *args: Any, **kwargs: Any) -> Any:
|
||||
if not self.is_logged:
|
||||
raise Exception("You must be logged in to use this method")
|
||||
return method(self, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user