mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 10:37:54 -06:00
fix: register every romfolders format
This commit is contained in:
1 parent
589174c369
commit
bac3070228
1 file changed
+10
-5
@@ -143,11 +143,16 @@ def register(name: str) -> Callable[[Parser], Parser]:
|
||||
|
||||
|
||||
def load_formats() -> dict[str, Parser]:
|
||||
"""Import every parser module of this package once."""
|
||||
if not FORMATS:
|
||||
for info in pkgutil.iter_modules([str(Path(__file__).parent)]):
|
||||
if not info.name.startswith("_"):
|
||||
importlib.import_module(f"{__name__}.{info.name}")
|
||||
"""Import every parser module of this package once.
|
||||
|
||||
Testing FORMATS for emptiness stopped short once a scraper had imported
|
||||
one parser module on its own (retrodeck_scraper reads romfolders.es):
|
||||
the other formats were never registered. import_module returns a module
|
||||
already loaded at once, so every call goes through all of them.
|
||||
"""
|
||||
for info in pkgutil.iter_modules([str(Path(__file__).parent)]):
|
||||
if not info.name.startswith("_"):
|
||||
importlib.import_module(f"{__name__}.{info.name}")
|
||||
return FORMATS
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user