From d9f0481cddbea7c0d2908dc8049709fc1be7d278 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 9 May 2022 11:20:19 -0500 Subject: [PATCH] Add progress bar to normalization.compile, add tilde for whitespace errors --- server/normalization/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/normalization/main.py b/server/normalization/main.py index 85399a6..734655b 100644 --- a/server/normalization/main.py +++ b/server/normalization/main.py @@ -270,7 +270,7 @@ def ids(): if len(unseen_chars) > 0: for unseen in unseen_chars: root.append(pre_existing[unseen]) - logger.debug(f'Character preserved but not seen: {unseen}') + logger.debug(f'Character preserved but not seen: `{unseen}`') logger.debug('Exporting identifiers file.') with open(ConstantPaths.IDENTIFIERS, 'w') as identifier_file: @@ -398,6 +398,8 @@ def compile() -> None: episode_files = os.listdir(EPISODES_DIR) logger.debug(f'Beginning processing for {len(episode_files)} episode files.') + pbar = enlighten.Counter(total=len(episode_files), unit='Episodes') + for file in episode_files: file_path = os.path.join(EPISODES_DIR, file) output_path = os.path.join(COMPILE_DIR, file) @@ -465,6 +467,8 @@ def compile() -> None: etree.indent(compile_root, space=" " * 4) compile_file.write(etree.tostring(compile_root, encoding=str, pretty_print=True)) + pbar.update() + logger.info('Completed episode data compiling.')