Using a named tuple to store source locations

This commit is contained in:
GeoffreyCoulaud
2023-07-26 03:53:17 +02:00
parent 0b577d2480
commit f3dcdbf0d2
9 changed files with 172 additions and 118 deletions

View File

@@ -19,8 +19,8 @@
import sys
from abc import abstractmethod
from collections.abc import Iterable, Iterator
from typing import Any, Generator, Optional
from collections.abc import Iterable
from typing import Any, Generator, Optional, Collection
from src.game import Game
from src.importer.sources.location import Location
@@ -54,10 +54,8 @@ class Source(Iterable):
name: str
variant: str = None
available_on: set[str] = set()
data_location: Optional[Location] = None
cache_location: Optional[Location] = None
config_location: Optional[Location] = None
iterable_class: type[SourceIterable]
locations: Collection[Location]
@property
def full_name(self) -> str: