1
0
Fork 0
mirror of https://github.com/ldericher/fftcgtool synced 2025-01-15 15:02:59 +00:00

better inheritance

This commit is contained in:
Jörn-Michael Miehe 2021-08-09 06:47:59 +02:00
parent e889689bcc
commit c34b7856a4
3 changed files with 3 additions and 5 deletions

View file

@ -7,8 +7,6 @@ class Cards(list[Card]):
__API_URL = "https://fftcg.square-enix-games.com/de/get-cards"
def __init__(self, params: dict[str, any]):
list.__init__(self)
# required params:
# text
# supported params:
@ -20,7 +18,7 @@ class Cards(list[Card]):
params["text"] = ""
req = requests.post(Cards.__API_URL, json=params)
self.extend([Card(card_data) for card_data in req.json()["cards"]])
super().__init__([Card(card_data) for card_data in req.json()["cards"]])
def __str__(self) -> str:
return "\n".join(str(card) for card in self)

View file

@ -9,7 +9,7 @@ from PIL import Image
class ImageLoader(threading.Thread):
def __init__(self, url_queue: queue.Queue, resolution: tuple[int, int], language: str):
threading.Thread.__init__(self)
super().__init__()
self.__queue = url_queue
self.__resolution = resolution

View file

@ -30,7 +30,7 @@ class Opus(Cards):
self.__number = "?"
self.__name = "?"
Cards.__init__(self, params)
super().__init__(params)
# remove reprints
for card in self: