From e8103093031ea086db2872c381763594ee530de0 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Sun, 22 Sep 2024 21:59:11 +0300 Subject: [PATCH] b/c..py: use word "output" only for audio --- bytebeat_compiler.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index c820793..ebd57f4 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -24,7 +24,7 @@ PATHS = { "bin_dir": "bin", "template": "template.c", "substitute": "substituted.c", - "output": "render_bytebeat", + "executable": "render_bytebeat", "fwrite_le_header": "fwrite_le.h", "fwrite_le": "fwrite_le.c", "include_directory": "include" @@ -38,7 +38,7 @@ for key in ["src_dir", "bin_dir", "include_directory"]: # Resolve paths PATHS["template"] = path_join(PATHS["src_dir"], PATHS["template"]) PATHS["substitute_kept"] = path_join(PATHS["bin_dir"], PATHS["substitute"]) -PATHS["output_kept"] = path_join(PATHS["bin_dir"], PATHS["output"]) +PATHS["executable_kept"] = path_join(PATHS["bin_dir"], PATHS["executable"]) PATHS["fwrite_le"] = path_join(PATHS["src_dir"], PATHS["fwrite_le"]) # Default parameters @@ -93,7 +93,7 @@ def run_command(*command: list[str]) -> None: print("An error occured during rendering!") raise SystemExit(EXIT_FAILURE) -def compile_substituted_file(input_file: str, output_file: str) -> None: +def compile_substituted_file(input_file: str, executable_file: str) -> None: print("Compiling") run_command( @@ -101,15 +101,15 @@ def compile_substituted_file(input_file: str, output_file: str) -> None: *command_line_split(CFLAGS), input_file, PATHS["fwrite_le"], - "-o", output_file, + "-o", executable_file, "-I" + PATHS["include_directory"] ) - run_command(output_file) + run_command(executable_file) -def main_workflow(input_file: str, output_file: str, \ +def main_workflow(input_file: str, executable_file: str, \ substitute_contents: Dict[str, str]) -> None: overwrite_file(input_file, substitute_contents) - compile_substituted_file(input_file, output_file) + compile_substituted_file(input_file, executable_file) preprocessor_bool = lambda value: "1" if value else "0" C_str_repr = lambda s: '"' + s.replace("\\", "\\\\").replace(r'"', r'\"') + '"' @@ -299,14 +299,14 @@ if __name__ == "__main__": makedirs(PATHS["bin_dir"], exist_ok=True) substitute_file = PATHS["substitute_kept"] - output_file = PATHS["output_kept"] + executable_file = PATHS["executable_kept"] - main_workflow(substitute_file, output_file, substitute_contents) + main_workflow(substitute_file, executable_file, substitute_contents) else: with TemporaryDirectory() as tmpdirname: temporary_path = lambda path: path_join(tmpdirname, path) substitute_temp = temporary_path(PATHS["substitute"]) - output_temp = temporary_path(PATHS["output"]) + executable_temp = temporary_path(PATHS["executable"]) - main_workflow(substitute_temp, output_temp, substitute_contents) + main_workflow(substitute_temp, executable_temp, substitute_contents)