From 7bcb113a3377353b80a127d6dde5b015f3a2e4db Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Sat, 22 Jul 2023 00:06:16 +0200 Subject: [PATCH] extracted get_hidden_app_names to a method --- src/importer/sources/heroic_source.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/importer/sources/heroic_source.py b/src/importer/sources/heroic_source.py index 73461e8..d169129 100644 --- a/src/importer/sources/heroic_source.py +++ b/src/importer/sources/heroic_source.py @@ -301,10 +301,12 @@ class HeroicSourceIterable(SourceIterable): def is_hidden(self, app_name: str) -> bool: return app_name in self.hidden_app_names - def __iter__(self): - """Generator method producing games from all the Heroic sub-sources""" + def get_hidden_app_names(self) -> set[str]: + """Get the hidden app names from store/config.json + + :raises InvalidStoreFileError: if the store is invalid for some reason + """ - # Get the hidden app names try: store = path_json_load(self.source.config_location["store_config.json"]) self.hidden_app_names = { @@ -318,6 +320,11 @@ class HeroicSourceIterable(SourceIterable): logging.error("Invalid Heroic store file", exc_info=error) raise InvalidStoreFileError() from error + def __iter__(self): + """Generator method producing games from all the Heroic sub-sources""" + + self.get_hidden_app_names() + # Get games from the sub sources for sub_source_class in ( SideloadIterable,