You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
872 B
29 lines
872 B
|
1 year ago
|
from PyQt6.QtCore import QObject, pyqtSignal, QRunnable
|
||
|
|
from bs4 import BeautifulSoup
|
||
|
|
from cache import cache
|
||
|
|
from db import db
|
||
|
|
|
||
|
|
class GatherEvolutionsWorkerSignals(QObject):
|
||
|
|
finished = pyqtSignal(list)
|
||
|
|
|
||
|
|
class GatherHEvolutions(QRunnable):
|
||
|
|
def __init__(self):
|
||
|
|
super().__init__()
|
||
|
|
self.signals = GatherEvolutionsWorkerSignals()
|
||
|
|
self.base_url = "https://www.serebii.net/pokemonhome/"
|
||
|
|
|
||
|
|
def run(self):
|
||
|
|
try:
|
||
|
|
gathered_data = self.gather_evolution_data()
|
||
|
|
self.signals.finished.emit(gathered_data)
|
||
|
|
except Exception as e:
|
||
|
|
print(f"Error gathering Pokémon home storage status: {e}")
|
||
|
|
|
||
|
|
def gather_evolution_data(self):
|
||
|
|
all_pokemon_forms = db.get_list_of_pokemon_forms()
|
||
|
|
evolutions = []
|
||
|
|
|
||
|
|
for pokemon_form in all_pokemon_forms:
|
||
|
|
pass
|
||
|
|
|
||
|
|
return evolutions
|