aboutsummaryrefslogtreecommitdiffstats
path: root/tpblite/models
diff options
context:
space:
mode:
authorJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 17:11:09 +0100
committerJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 17:11:09 +0100
commit4418d8c73b26639016733bc0a3264a96046c6ab1 (patch)
treec2aa2b2636acd81e78223284e8ad616ad250bb3a /tpblite/models
parentfdb0167687f1772ff4b2363010e417234061af04 (diff)
downloadtpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.tar.gz
tpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.tar.bz2
tpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.zip
Fixing mistakes related to type hinting.
Diffstat (limited to 'tpblite/models')
-rw-r--r--tpblite/models/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tpblite/models/utils.py b/tpblite/models/utils.py
index dd03b55..6c479d4 100644
--- a/tpblite/models/utils.py
+++ b/tpblite/models/utils.py
@@ -1,4 +1,4 @@
-from typing import Tuple, TypeVar
+from typing import Tuple, Type, TypeVar
import random
from urllib.request import Request, urlopen
import urllib.error
@@ -31,13 +31,13 @@ class QueryParser:
@classmethod
def search(
- cls, query: str, base_url: str, page: int, order: int, category: int
+ cls: Type[T], query: str, base_url: str, page: int, order: int, category: int
) -> T:
segments = ("search", query, str(page), str(order), str(category))
return cls(base_url, segments)
@classmethod
- def browse(cls, base_url: str, category: int, page: int, order: int) -> T:
+ def browse(cls: Type[T], base_url: str, category: int, page: int, order: int) -> T:
# The 0 is added to the URL to stay consistent with the manual web request
segments = ("browse", str(category), str(page), str(order), "0")
return cls(base_url, segments)