📝 Consistent typing in exsiting sources
This commit is contained in:
@@ -112,8 +112,8 @@ class HeroicSourceIterator(SourceIterator):
|
||||
continue
|
||||
yield game
|
||||
|
||||
def __init__(self, source: "HeroicSource") -> None:
|
||||
self.source = source
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.generator = self.sub_sources_generator()
|
||||
|
||||
def __next__(self) -> Optional[Game]:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from sqlite3 import connect
|
||||
from time import time
|
||||
from typing import Optional
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
@@ -27,7 +28,7 @@ class LutrisSourceIterator(SourceIterator):
|
||||
"""
|
||||
db_request_params = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.import_steam = shared.schema.get_boolean("lutris-import-steam")
|
||||
self.db_location = self.source.location / "pga.db"
|
||||
@@ -37,9 +38,7 @@ class LutrisSourceIterator(SourceIterator):
|
||||
self.db_games_request, self.db_request_params
|
||||
)
|
||||
|
||||
def __next__(self):
|
||||
"""Produce games"""
|
||||
|
||||
def __next__(self) -> Optional[Game]:
|
||||
row = None
|
||||
try:
|
||||
row = self.db_cursor.__next__()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import Iterator
|
||||
from typing import Iterator, Optional
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
@@ -27,7 +27,7 @@ class SteamSourceIterator(SourceIterator):
|
||||
installed_state_mask: int = 4
|
||||
appid_cache: set = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.appid_cache = set()
|
||||
@@ -56,9 +56,7 @@ class SteamSourceIterator(SourceIterator):
|
||||
|
||||
self.manifests_iterator = iter(self.manifests)
|
||||
|
||||
def __next__(self):
|
||||
"""Produce games"""
|
||||
|
||||
def __next__(self) -> Optional[Game]:
|
||||
# Get metadata from manifest
|
||||
manifest_path = next(self.manifests_iterator)
|
||||
steam = SteamHelper()
|
||||
|
||||
Reference in New Issue
Block a user