From 7c5c92f27ad77c97ce9d179009018715eb4c7925 Mon Sep 17 00:00:00 2001 From: tiagovla Date: Wed, 19 Jul 2023 04:10:42 -0300 Subject: [PATCH] chore: add type hints --- ppgee/http.py | 3 ++- ppgee/pages/attendency.py | 2 +- ppgee/permissions.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ppgee/http.py b/ppgee/http.py index 9247e99..9ffa7af 100644 --- a/ppgee/http.py +++ b/ppgee/http.py @@ -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() diff --git a/ppgee/pages/attendency.py b/ppgee/pages/attendency.py index 0e3348a..b25671f 100644 --- a/ppgee/pages/attendency.py +++ b/ppgee/pages/attendency.py @@ -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: diff --git a/ppgee/permissions.py b/ppgee/permissions.py index d79c2d3..a18c1b3 100644 --- a/ppgee/permissions.py +++ b/ppgee/permissions.py @@ -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)