Skip to content

Commit

Permalink
mypy + merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit committed May 8, 2024
1 parent c1e2265 commit 8bac615
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/open_samus_returns_rando/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from .patch_util import patch_with_status_update


def patch(input_path: Path, output_path: Path, configuration: dict) -> None:
def patch(input_path: Path, input_exheader: Path, output_path: Path, configuration: dict) -> None:
from .samus_returns_patcher import patch_extracted
return patch_extracted(input_path, output_path, configuration)
return patch_extracted(input_path, input_exheader, output_path, configuration)


__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion src/open_samus_returns_rando/lua_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _read_level_lua(level_id: str) -> str:
"s110_surfaceb": "s00",
}

def get_parent_for(item_id) -> str:
def get_parent_for(item_id: str) -> str:
return SPECIFIC_CLASSES.get(item_id, "RandomizerPowerup")

class ScriptClass:
Expand Down
6 changes: 3 additions & 3 deletions src/open_samus_returns_rando/multiworld_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from open_samus_returns_rando.misc_patches.lua_util import lua_convert


def get_lua_for_item(progression: list[list[dict[str, str | int]]]):
def get_lua_for_item(progression: list[list[dict[str, str | int]]]) -> str:
generic_pickup = """
Game.ImportLibrary("actors/items/randomizerpowerup/scripts/randomizerpowerup.lc", false)
MultiworldPickup = MultiworldPickup or {}
Expand Down Expand Up @@ -33,13 +33,13 @@ def get_lua_for_item(progression: list[list[dict[str, str | int]]]):
)


def create_exefs_patches(out_code: Path, out_exheader: Path, input_exheader: Path, enabled: bool, region: str):
def create_exefs_patches(out_code: Path, out_exheader: Path, input_exheader: Path, enabled: bool, region: str) -> None:
if not enabled:
return

import shutil

import ips
import ips # type: ignore

# Citra and Luma don't support patching the exheader. User needs to provide it as input and
# here the patch is just applied
Expand Down
4 changes: 2 additions & 2 deletions src/open_samus_returns_rando/samus_returns_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def add_custom_files(editor: PatcherEditor) -> None:



def validate(configuration: dict, input_exheader: Path | None):
def validate(configuration: dict, input_exheader: Path | None) -> None:
# validate patcher json with the schema.json
DefaultValidatingDraft7Validator(_read_schema()).validate(configuration)

Expand All @@ -66,7 +66,7 @@ def validate(configuration: dict, input_exheader: Path | None):



def patch_extracted(input_path: Path, input_exheader: Path, output_path: Path, configuration: dict):
def patch_extracted(input_path: Path, input_exheader: Path, output_path: Path, configuration: dict) -> None:
LOG.info("Will patch files from %s", input_path)

validate(configuration, input_exheader)
Expand Down

0 comments on commit 8bac615

Please sign in to comment.