Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ repos:
rev: v1.4.1
hooks:
- id: jsonschema-to-typeddict
files: src/mars_patcher/data/schema.json
args: [ --output-path, src/mars_patcher/auto_generated_types.py, --root-name, MarsSchema ]
files: src/mars_patcher/mf/data/schema.json
args: [ --output-path, src/mars_patcher/mf/auto_generated_types.py, --root-name, MarsSchemaMF ]

- repo: https://github.com/henriquegemignani/jsonschema-to-typeddict
rev: v1.4.1
hooks:
- id: jsonschema-to-typeddict
files: src/mars_patcher/zm/data/schema.json
args: [ --output-path, src/mars_patcher/zm/auto_generated_types.py, --root-name, MarsSchemaZM ]
2 changes: 1 addition & 1 deletion pull-assembly-patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DESTINATION_ASSEMBLY_PATH = (
Path(__file__)
.parent.resolve()
.joinpath("src", "mars_patcher", "data", "patches", "mf_u", "asm")
.joinpath("src", "mars_patcher", "mf", "data", "patches", "mf_u", "asm")
)


Expand Down
6 changes: 3 additions & 3 deletions src/mars_patcher/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import json

from mars_patcher.patcher import patch, validate_patch_data
from mars_patcher.patcher import patch


def main() -> None:
Expand All @@ -11,13 +11,13 @@ def main() -> None:
parser.add_argument("patch_data_path", type=str, help="Path to patch data json file")
args = parser.parse_args()

# Load patch data file and validate
# Load patch data file
with open(args.patch_data_path, encoding="utf-8") as f:
patch_data = json.load(f)

patch(
args.rom_path,
args.out_path,
validate_patch_data(patch_data),
patch_data,
lambda message, progress: print(message),
)
2 changes: 1 addition & 1 deletion src/mars_patcher/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@


def get_data_path(*path: str | os.PathLike) -> str:
return os.fspath(Path(__file__).parent.joinpath("data", *path))
return os.fspath(Path(__file__).parent.joinpath("mf", "data", *path))
Loading