Auto import worlds to trigger registration

This commit is contained in:
Fabian Dill 2021-06-29 03:49:29 +02:00
parent 10aca70879
commit 328d448ab2
2 changed files with 12 additions and 1 deletions

View File

@ -88,7 +88,7 @@ cx_Freeze.setup(
"excludes": ["numpy", "Cython", "PySide2", "PIL", "excludes": ["numpy", "Cython", "PySide2", "PIL",
"pandas"], "pandas"],
"zip_include_packages": ["*"], "zip_include_packages": ["*"],
"zip_exclude_packages": [], "zip_exclude_packages": ["worlds"],
"include_files": [], "include_files": [],
"include_msvcr": True, "include_msvcr": True,
"replace_paths": [("*", "")], "replace_paths": [("*", "")],

View File

@ -1,10 +1,13 @@
import enum import enum
import importlib
import os
__all__ = {"lookup_any_item_id_to_name", __all__ = {"lookup_any_item_id_to_name",
"lookup_any_location_id_to_name", "lookup_any_location_id_to_name",
"network_data_package", "network_data_package",
"Games"} "Games"}
# all of the below should be moved to AutoWorld functionality
from .alttp.Items import lookup_id_to_name as alttp from .alttp.Items import lookup_id_to_name as alttp
from .hk.Items import lookup_id_to_name as hk from .hk.Items import lookup_id_to_name as hk
from .factorio import Technologies from .factorio import Technologies
@ -38,3 +41,11 @@ class Games(str, enum.Enum):
LTTP = "A Link to the Past" LTTP = "A Link to the Past"
Factorio = "Factorio" Factorio = "Factorio"
Minecraft = "Minecraft" 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")