extracted get_hidden_app_names to a method
This commit is contained in:
@@ -301,10 +301,12 @@ class HeroicSourceIterable(SourceIterable):
|
|||||||
def is_hidden(self, app_name: str) -> bool:
|
def is_hidden(self, app_name: str) -> bool:
|
||||||
return app_name in self.hidden_app_names
|
return app_name in self.hidden_app_names
|
||||||
|
|
||||||
def __iter__(self):
|
def get_hidden_app_names(self) -> set[str]:
|
||||||
"""Generator method producing games from all the Heroic sub-sources"""
|
"""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:
|
try:
|
||||||
store = path_json_load(self.source.config_location["store_config.json"])
|
store = path_json_load(self.source.config_location["store_config.json"])
|
||||||
self.hidden_app_names = {
|
self.hidden_app_names = {
|
||||||
@@ -318,6 +320,11 @@ class HeroicSourceIterable(SourceIterable):
|
|||||||
logging.error("Invalid Heroic store file", exc_info=error)
|
logging.error("Invalid Heroic store file", exc_info=error)
|
||||||
raise InvalidStoreFileError() from 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
|
# Get games from the sub sources
|
||||||
for sub_source_class in (
|
for sub_source_class in (
|
||||||
SideloadIterable,
|
SideloadIterable,
|
||||||
|
|||||||
Reference in New Issue
Block a user