From 328d448ab2604db7fdeec82e12c1a2247e226cdf Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 29 Jun 2021 03:49:29 +0200 Subject: [PATCH] Auto import worlds to trigger registration --- setup.py | 2 +- worlds/__init__.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 34bba7f4..e23878ea 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ cx_Freeze.setup( "excludes": ["numpy", "Cython", "PySide2", "PIL", "pandas"], "zip_include_packages": ["*"], - "zip_exclude_packages": [], + "zip_exclude_packages": ["worlds"], "include_files": [], "include_msvcr": True, "replace_paths": [("*", "")], diff --git a/worlds/__init__.py b/worlds/__init__.py index 5222f2cb..db5cc960 100644 --- a/worlds/__init__.py +++ b/worlds/__init__.py @@ -1,10 +1,13 @@ import enum +import importlib +import os __all__ = {"lookup_any_item_id_to_name", "lookup_any_location_id_to_name", "network_data_package", "Games"} +# all of the below should be moved to AutoWorld functionality from .alttp.Items import lookup_id_to_name as alttp from .hk.Items import lookup_id_to_name as hk from .factorio import Technologies @@ -38,3 +41,11 @@ class Games(str, enum.Enum): LTTP = "A Link to the Past" Factorio = "Factorio" Minecraft = "Minecraft" + + +# end of TODO block + +# import all submodules to trigger AutoWorldRegister +for file in os.scandir(os.path.dirname(__file__)): + if file.is_dir(): + importlib.import_module(f".{file.name}", "worlds")