Minor fixes

This commit is contained in:
Masahiko AMANO
2021-12-10 00:45:29 +03:00
parent 0ed8d1482b
commit f63cb6cb59
3 changed files with 5 additions and 10 deletions
+3 -3
View File
@@ -109,7 +109,7 @@ def shichiro_decode(byts):
def compress_file(filename):
global output
global log, output
log.log(f"Loading '{filename}'...")
with open(filename, 'rb') as file: # get data
data = list(map(int, file.read()))
@@ -143,7 +143,7 @@ def compress_file(filename):
def decompress_file(filename):
global output
global log, output
log.log(f"Loading '{filename}'...")
with open(filename, 'rb') as file: # get data
data = [bin(byte)[2:].rjust(8, '0') for byte in file.read()]
@@ -188,7 +188,7 @@ def decompress_file(filename):
@click.argument('files', nargs=-1, metavar='<file [file [...]]>')
@click.option('-c/-d', 'comp', default=True, help='Compress/decompress mode selectors.')
def CLI(files, comp):
global output
global log, output
log.log(f'hfm {"-c" * comp}{"-d" * (not comp)} "' + "\" \"".join(files) + '"')
for file in files:
output += '{'