Added lz77 compress command

This commit is contained in:
Campbell 2025-01-23 22:30:59 -05:00
parent 71c0726c4f
commit 5f751acabd
Signed by: NinjaCheetah
GPG Key ID: 39C2500E1778B156

View File

@ -7,7 +7,20 @@ from modules.core import fatal_error
def handle_lz77_compress(args):
print("Compression is not implemented yet.")
input_path = pathlib.Path(args.input)
if args.output is not None:
output_path = pathlib.Path(args.output)
else:
output_path = pathlib.Path(input_path.name + ".lz77")
if not input_path.exists():
fatal_error(f"The specified file \"{input_path}\" does not exist!")
lz77_data = input_path.read_bytes()
data = libWiiPy.archive.compress_lz77(lz77_data)
output_path.write_bytes(data)
print("LZ77 file compressed!")
def handle_lz77_decompress(args):