From f63cb6cb59e8c41fb690b00513f87529c587f935 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Fri, 10 Dec 2021 00:45:29 +0300 Subject: [PATCH] Minor fixes --- huffman.py | 6 +++--- index.html | 7 +------ script.js | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/huffman.py b/huffman.py index ac4ec5e..9457865 100644 --- a/huffman.py +++ b/huffman.py @@ -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='') @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 += '{' diff --git a/index.html b/index.html index c9778df..28ce5ce 100644 --- a/index.html +++ b/index.html @@ -5,12 +5,7 @@ HuffPress - + diff --git a/script.js b/script.js index 1c9c1be..7c02609 100644 --- a/script.js +++ b/script.js @@ -58,7 +58,7 @@ $('form').on('submit', function submit(e) { dataType: 'json', data: form, success: function (resp) { - if (resp===null) { + if (resp === null) { $('.process').css('display', 'none'); $('.error').css('display', 'block'); } else if (resp.status) {