From f27c87b291a920376e006a470efb353dee46ed17 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 31 May 2025 08:56:17 +0500 Subject: more formatting fixes --- codegen/lib/download.py | 161 +++++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 76 deletions(-) (limited to 'codegen/lib/download.py') diff --git a/codegen/lib/download.py b/codegen/lib/download.py index 43ca8d2a..238336e2 100644 --- a/codegen/lib/download.py +++ b/codegen/lib/download.py @@ -6,29 +6,33 @@ import json import os # make sure the cache directory exists -print('Making __cache__') -if not os.path.exists(get_dir_location('__cache__')): - print('Made __cache__ directory.', get_dir_location('__cache__')) - os.mkdir(get_dir_location('__cache__')) +print("Making __cache__") +if not os.path.exists(get_dir_location("__cache__")): + print("Made __cache__ directory.", get_dir_location("__cache__")) + os.mkdir(get_dir_location("__cache__")) def get_burger(): - if not os.path.exists(get_dir_location('__cache__/Burger')): - print('\033[92mDownloading Burger...\033[m') + if not os.path.exists(get_dir_location("__cache__/Burger")): + print("\033[92mDownloading Burger...\033[m") os.system( - f'cd {get_dir_location("__cache__")} && git clone https://github.com/mat-1/Burger && cd Burger && git pull') + f"cd {get_dir_location('__cache__')} && git clone https://github.com/mat-1/Burger && cd Burger && git pull" + ) - print('\033[92mInstalling dependencies...\033[m') - os.system(f'cd {get_dir_location("__cache__")}/Burger && python -m venv venv && venv/bin/pip install six jawa') + print("\033[92mInstalling dependencies...\033[m") + os.system( + f"cd {get_dir_location('__cache__')}/Burger && python -m venv venv && venv/bin/pip install six jawa" + ) def get_pumpkin_extractor(): - if not os.path.exists(get_dir_location('__cache__/pumpkin-extractor')): - print('\033[92mDownloading Pumpkin-MC/Extractor...\033[m') + if not os.path.exists(get_dir_location("__cache__/pumpkin-extractor")): + print("\033[92mDownloading Pumpkin-MC/Extractor...\033[m") os.system( - f'cd {get_dir_location("__cache__")} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull') - - GIT_PATCH = '''diff --git a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt + f"cd {get_dir_location('__cache__')} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull" + ) + + GIT_PATCH = """diff --git a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt index 936cd7b..9876a4b 100644 --- a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt +++ b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt @@ -51,166 +55,171 @@ index 936cd7b..9876a4b 100644 for (blockEntity in Registries.BLOCK_ENTITY_TYPE) { if (blockEntity.supports(state)) { -''' +""" os.system( - f'cd {get_dir_location("__cache__")}/pumpkin-extractor && git apply - <