From d835cdc9a21dc8145e4dd8fc5cb551a338695eca Mon Sep 17 00:00:00 2001 From: Nathaniel Rook Date: Wed, 27 Dec 2023 13:34:51 -0500 Subject: [PATCH] Revert "Add a management command to recompile the Kaitai structs." This reverts commit 6ecb0e4ca2d46271fd9f42606d5c75b73fe36a4a. --- README.md | 3 +- .../commands/kaitai_struct_compile.py | 30 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 project/thscoreboard/replays/management/commands/kaitai_struct_compile.py diff --git a/README.md b/README.md index 55e89d52..b605c734 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ We use Black, the Python formatting tool, to format our code automatically. As s ### Generating the replay parsers -Start by installing `kaitai-struct-compiler`. Once it is installed, -run `python manage.py kaitai_struct_compile`. Or, directly run the compiler: Navigate to `project/thscoreboard/replays/kaitai_parsers` and run `kaitai-struct-compiler -t python ../../../../ref/threp-ksy/*.ksy` (note that you don't need to change the slashes to backslashes to run this on Windows). +Start by installing `kaitai-struct-compiler`. Then, navigate to `project/thscoreboard/replays/kaitai_parsers` and run `kaitai-struct-compiler -t python ../../../../ref/threp-ksy/*.ksy` (note that you don't need to change the slashes to backslashes to run this on Windows). ### Database configuration diff --git a/project/thscoreboard/replays/management/commands/kaitai_struct_compile.py b/project/thscoreboard/replays/management/commands/kaitai_struct_compile.py deleted file mode 100644 index e8689f86..00000000 --- a/project/thscoreboard/replays/management/commands/kaitai_struct_compile.py +++ /dev/null @@ -1,30 +0,0 @@ -import logging -import subprocess -import pathlib - -from django.core.management import base -import pathlib - - -_PROJECT_ROOT = pathlib.Path(__file__).parent / "../../.." - - -def _ksy_files(): - ksy_dir = _PROJECT_ROOT / pathlib.Path("../../ref/threp-ksy/") - return [p.resolve() for p in ksy_dir.glob("*.ksy")] - - -class Command(base.BaseCommand): - help = """Recompile Kaitai Struct source files.""" - - def handle(*args, **options) -> None: - ksc_args = [ - "kaitai-struct-compiler", - "--target", - "python", - "--outdir", - _PROJECT_ROOT / "replays/kaitai_parsers", - ] + _ksy_files() - - logging.info("Running: %s", ksc_args) - subprocess.run(ksc_args)