diff options
Diffstat (limited to 'nextcloud_news_updater/api/api.py')
-rw-r--r-- | nextcloud_news_updater/api/api.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nextcloud_news_updater/api/api.py b/nextcloud_news_updater/api/api.py index 1f197f4..837583c 100644 --- a/nextcloud_news_updater/api/api.py +++ b/nextcloud_news_updater/api/api.py @@ -1,4 +1,5 @@ import json +from typing import List, Any class Feed: @@ -6,13 +7,13 @@ class Feed: Payload object for update infos """ - def __init__(self, feed_id, user_id): + def __init__(self, feed_id: int, user_id: str) -> None: self.feed_id = feed_id self.user_id = user_id class Api: - def parse_feed(self, json_string): + def parse_feed(self, json_string: str) -> List[Feed]: """ Wrapper around json.loads for better error messages """ @@ -23,6 +24,6 @@ class Api: msg = "Could not parse given JSON: %s" % json_string raise ValueError(msg) - def _parse_json(self, feed_json): + def _parse_json(self, feed_json: Any) -> List[Feed]: feed_json = feed_json['feeds'] return [Feed(info['id'], info['userId']) for info in feed_json] |