From c0bb3d43f9c51d92cdddfee2f4cbf6139fd4f9a5 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Apr 2020 20:54:31 +0200 Subject: Add more type hints --- pyfunkwhale/client.py | 4 +++- pyfunkwhale/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py index 2221a35..49df688 100644 --- a/pyfunkwhale/client.py +++ b/pyfunkwhale/client.py @@ -4,6 +4,7 @@ import json from time import time from requests_oauthlib import OAuth2Session +from requests.models import Response from pyfunkwhale.utils import read_file, write_file @@ -70,7 +71,8 @@ class Client(object): client_secret=self.client_secret) write_file(self.token_filename, self.token) - def call(self, endpoint, method, params=None, data=None): + def call(self, endpoint: str, method: str, params: dict = None, + data: dict = None) -> Response: """ Call the API diff --git a/pyfunkwhale/utils.py b/pyfunkwhale/utils.py index eb6da03..b92d2b9 100644 --- a/pyfunkwhale/utils.py +++ b/pyfunkwhale/utils.py @@ -4,7 +4,7 @@ import json -def read_file(filename): +def read_file(filename: str) -> str: """ Simple wrapper for read a file content @@ -19,7 +19,7 @@ def read_file(filename): return data -def write_file(filename, datas): +def write_file(filename: str, datas: str) -> str: """ Simple wrapper for write data in file -- cgit v1.2.1