mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-26 13:21:01 -04:00
Added lz77 compress command
This commit is contained in:
parent
71c0726c4f
commit
5f751acabd
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user