Skip to content

Commit e3eb0b3

Browse files
committed
Reduce Any type usage
1 parent 1e47b0f commit e3eb0b3

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

nova3/engines/eztv.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# VERSION: 1.20
1+
# VERSION: 1.21
22
# AUTHORS: nindogo
33
# CONTRIBUTORS: Diego de las Heras ([email protected])
44

@@ -10,7 +10,7 @@
1010
import urllib.request
1111
from datetime import datetime, timedelta
1212
from html.parser import HTMLParser
13-
from typing import Any, Callable, Dict, List, Mapping, Match, Tuple, Union
13+
from typing import Callable, Dict, List, Mapping, Match, Tuple, Union
1414

1515
from helpers import retrieve_url
1616
from novaprinter import prettyPrinter
@@ -38,10 +38,10 @@ def __init__(self, url: str) -> None:
3838
r"(\d+)\s+years?": lambda m: now - timedelta(days=int(m[1]) * 365),
3939
}
4040
self.in_table_row = False
41-
self.current_item: Dict[str, Any] = {}
41+
self.current_item: Dict[str, object] = {}
4242

4343
def handle_starttag(self, tag: str, attrs: List[Tuple[str, Union[str, None]]]) -> None:
44-
def getStr(d: Mapping[str, Any], key: str) -> str:
44+
def getStr(d: Mapping[str, Union[str, None]], key: str) -> str:
4545
value = d.get(key, '')
4646
return value if value is not None else ''
4747

nova3/engines/limetorrents.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# VERSION: 4.12
1+
# VERSION: 4.13
22
# AUTHORS: Lima66
33
# CONTRIBUTORS: Diego de las Heras ([email protected])
44

55
import re
66
from datetime import datetime, timedelta
77
from html.parser import HTMLParser
8-
from typing import Any, Callable, Dict, List, Mapping, Match, Tuple, Union
8+
from typing import Callable, Dict, List, Mapping, Match, Tuple, Union
99
from urllib.parse import quote
1010

1111
from helpers import retrieve_url
@@ -34,7 +34,7 @@ def error(self, message: str) -> None:
3434
def __init__(self, url: str) -> None:
3535
HTMLParser.__init__(self)
3636
self.url = url
37-
self.current_item: Dict[str, Any] = {} # dict for found item
37+
self.current_item: Dict[str, object] = {} # dict for found item
3838
self.page_items = 0
3939
self.inside_table = False
4040
self.inside_tr = False

nova3/engines/solidtorrents.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# VERSION: 2.6
1+
# VERSION: 2.7
22
# AUTHORS: nKlido
33

44
# LICENSING INFORMATION
@@ -22,7 +22,7 @@
2222

2323
from datetime import datetime
2424
from html.parser import HTMLParser
25-
from typing import Any, Dict, List, Mapping, Tuple, Union
25+
from typing import Dict, List, Mapping, Tuple, Union
2626

2727
from helpers import retrieve_url
2828
from novaprinter import prettyPrinter
@@ -52,7 +52,7 @@ def __init__(self, url: str) -> None:
5252

5353
self.torrent_info = self.empty_torrent_info()
5454

55-
def empty_torrent_info(self) -> Dict[str, Any]:
55+
def empty_torrent_info(self) -> Dict[str, object]:
5656
return {
5757
'link': '',
5858
'name': '',
@@ -65,7 +65,7 @@ def empty_torrent_info(self) -> Dict[str, Any]:
6565
}
6666

6767
def handle_starttag(self, tag: str, attrs: List[Tuple[str, Union[str, None]]]) -> None:
68-
def getStr(d: Mapping[str, Any], key: str) -> str:
68+
def getStr(d: Mapping[str, Union[str, None]], key: str) -> str:
6969
value = d.get(key, '')
7070
return value if value is not None else ''
7171

nova3/engines/torrentproject.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# VERSION: 1.7
1+
# VERSION: 1.8
22
# AUTHORS: mauricci
33

44
import re
@@ -33,8 +33,8 @@ def __init__(self, url: str) -> None:
3333
"pub_date": 4,
3434
"size": 5,
3535
}
36-
self.fullResData: List[Any] = []
37-
self.pageRes: List[Any] = []
36+
self.fullResData: List[object] = []
37+
self.pageRes: List[object] = []
3838
self.singleResData = self.get_single_data()
3939

4040
def get_single_data(self) -> Dict[str, Any]:
@@ -50,7 +50,7 @@ def get_single_data(self) -> Dict[str, Any]:
5050
}
5151

5252
def handle_starttag(self, tag: str, attrs: List[Tuple[str, Union[str, None]]]) -> None:
53-
def getStr(d: Mapping[str, Any], key: str) -> str:
53+
def getStr(d: Mapping[str, Union[str, None]], key: str) -> str:
5454
value = d.get(key, '')
5555
return value if value is not None else ''
5656

nova3/engines/versions.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
eztv: 1.20
1+
eztv: 1.21
22
jackett: 4.6
3-
limetorrents: 4.12
3+
limetorrents: 4.13
44
piratebay: 3.8
5-
solidtorrents: 2.6
5+
solidtorrents: 2.7
66
torlock: 2.27
7-
torrentproject: 1.7
7+
torrentproject: 1.8
88
torrentscsv: 1.7

0 commit comments

Comments
 (0)