From 324d3cf04266b9515e21252c3332c297d6aabfe3 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sat, 20 May 2023 19:21:39 +0200 Subject: [PATCH] Main: add __all__ and change wrong imports (#1824) * Main: add __all__ and change wrong imports * Adjusters: fix __version__ import --- LttPAdjuster.py | 2 +- Main.py | 2 ++ OoTAdjuster.py | 2 +- worlds/adventure/__init__.py | 2 +- worlds/alttp/Rom.py | 2 +- worlds/dkc3/Rom.py | 2 +- worlds/sm/__init__.py | 2 +- worlds/smw/Rom.py | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/LttPAdjuster.py b/LttPAdjuster.py index db0f760e..608ce67a 100644 --- a/LttPAdjuster.py +++ b/LttPAdjuster.py @@ -193,7 +193,7 @@ def adjustGUI(): from tkinter import Tk, LEFT, BOTTOM, TOP, \ StringVar, Frame, Label, X, Entry, Button, filedialog, messagebox, ttk from argparse import Namespace - from Main import __version__ as MWVersion + from Utils import __version__ as MWVersion adjustWindow = Tk() adjustWindow.wm_title("Archipelago %s LttP Adjuster" % MWVersion) set_icon(adjustWindow) diff --git a/Main.py b/Main.py index 24cba722..c43c0804 100644 --- a/Main.py +++ b/Main.py @@ -20,6 +20,8 @@ from worlds.alttp.Shops import FillDisabledShopSlots from worlds.alttp.SubClasses import LTTPRegionType from worlds.generic.Rules import exclusion_rules, locality_rules +__all__ = ["main"] + ordered_areas = ( 'Light World', 'Dark World', 'Hyrule Castle', 'Agahnims Tower', 'Eastern Palace', 'Desert Palace', 'Tower of Hera', 'Palace of Darkness', 'Swamp Palace', 'Skull Woods', 'Thieves Town', 'Ice Palace', diff --git a/OoTAdjuster.py b/OoTAdjuster.py index f449113d..38ebe62e 100644 --- a/OoTAdjuster.py +++ b/OoTAdjuster.py @@ -44,7 +44,7 @@ def adjustGUI(): StringVar, IntVar, Checkbutton, Frame, Label, X, Entry, Button, \ OptionMenu, filedialog, messagebox, ttk from argparse import Namespace - from Main import __version__ as MWVersion + from Utils import __version__ as MWVersion window = tk.Tk() window.wm_title(f"Archipelago {MWVersion} OoT Adjuster") diff --git a/worlds/adventure/__init__.py b/worlds/adventure/__init__.py index eba887a6..59383977 100644 --- a/worlds/adventure/__init__.py +++ b/worlds/adventure/__init__.py @@ -8,7 +8,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set, Tuple from BaseClasses import Entrance, Item, ItemClassification, MultiWorld, Region, Tutorial, \ LocationProgressType -from Main import __version__ +from Utils import __version__ from Options import AssembleOptions from worlds.AutoWorld import WebWorld, World from Fill import fill_restrictive diff --git a/worlds/alttp/Rom.py b/worlds/alttp/Rom.py index a9dba327..2f5fc0cc 100644 --- a/worlds/alttp/Rom.py +++ b/worlds/alttp/Rom.py @@ -1658,7 +1658,7 @@ def patch_rom(world: MultiWorld, rom: LocalRom, player: int, enemized: bool): # set rom name # 21 bytes - from Main import __version__ + from Utils import __version__ rom.name = bytearray(f'AP{__version__.replace(".", "")[0:3]}_{player}_{world.seed:11}\0', 'utf8')[:21] rom.name.extend([0] * (21 - len(rom.name))) rom.write_bytes(0x7FC0, rom.name) diff --git a/worlds/dkc3/Rom.py b/worlds/dkc3/Rom.py index c193e909..4255a0a3 100644 --- a/worlds/dkc3/Rom.py +++ b/worlds/dkc3/Rom.py @@ -667,7 +667,7 @@ def patch_rom(world, rom, player, active_level_list): rom.write_bytes(0x32A5DF, bytearray([0x41, 0x52, 0x43, 0x48, 0x49, 0x50, 0x45, 0x4C, 0x41, 0x47, 0x4F, 0x20, 0x4D, 0x4F, 0xC4])) # "ARCHIPELAGO MOD" rom.write_bytes(0x32A5EE, bytearray([0x00, 0x03, 0x50, 0x4F, 0x52, 0x59, 0x47, 0x4F, 0x4E, 0xC5])) # "PORYGONE" - from Main import __version__ + from Utils import __version__ rom.name = bytearray(f'D3{__version__.replace(".", "")[0:3]}_{player}_{world.seed:11}\0', 'utf8')[:21] rom.name.extend([0] * (21 - len(rom.name))) rom.write_bytes(0x7FC0, rom.name) diff --git a/worlds/sm/__init__.py b/worlds/sm/__init__.py index d60b0f51..05190211 100644 --- a/worlds/sm/__init__.py +++ b/worlds/sm/__init__.py @@ -641,7 +641,7 @@ class SMWorld(World): # set rom name # 21 bytes - from Main import __version__ + from Utils import __version__ self.romName = bytearray(f'SM{__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed:11}', 'utf8')[:21] self.romName.extend([0] * (21 - len(self.romName))) # clients should read from 0x7FC0, the location of the rom title in the SNES header. diff --git a/worlds/smw/Rom.py b/worlds/smw/Rom.py index ffd89237..0f5ec7e4 100644 --- a/worlds/smw/Rom.py +++ b/worlds/smw/Rom.py @@ -945,7 +945,7 @@ def patch_rom(world, rom, player, active_level_dict): rom.write_byte(0x01BFA7, world.swap_donut_gh_exits[player].value) - from Main import __version__ + from Utils import __version__ rom.name = bytearray(f'SMW{__version__.replace(".", "")[0:3]}_{player}_{world.seed:11}\0', 'utf8')[:21] rom.name.extend([0] * (21 - len(rom.name))) rom.write_bytes(0x7FC0, rom.name)