aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-04-11 20:54:31 +0200
committerneodarz <neodarz@neodarz.net>2020-04-11 20:54:31 +0200
commitc0bb3d43f9c51d92cdddfee2f4cbf6139fd4f9a5 (patch)
tree7879ad52a006a678db2b8d2f92edcf8df664e640
parente1639c0f20d56d05517a6e16aca768094b5e77ba (diff)
downloadpyfunkwhale-c0bb3d43f9c51d92cdddfee2f4cbf6139fd4f9a5.tar.xz
pyfunkwhale-c0bb3d43f9c51d92cdddfee2f4cbf6139fd4f9a5.zip
Add more type hints
-rw-r--r--pyfunkwhale/client.py4
-rw-r--r--pyfunkwhale/utils.py4
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