mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-10 12:08:52 -06:00
Add progress bar to normalization.compile, add tilde for whitespace errors
This commit is contained in:
@@ -270,7 +270,7 @@ def ids():
|
|||||||
if len(unseen_chars) > 0:
|
if len(unseen_chars) > 0:
|
||||||
for unseen in unseen_chars:
|
for unseen in unseen_chars:
|
||||||
root.append(pre_existing[unseen])
|
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.')
|
logger.debug('Exporting identifiers file.')
|
||||||
with open(ConstantPaths.IDENTIFIERS, 'w') as identifier_file:
|
with open(ConstantPaths.IDENTIFIERS, 'w') as identifier_file:
|
||||||
@@ -398,6 +398,8 @@ def compile() -> None:
|
|||||||
episode_files = os.listdir(EPISODES_DIR)
|
episode_files = os.listdir(EPISODES_DIR)
|
||||||
logger.debug(f'Beginning processing for {len(episode_files)} episode files.')
|
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:
|
for file in episode_files:
|
||||||
file_path = os.path.join(EPISODES_DIR, file)
|
file_path = os.path.join(EPISODES_DIR, file)
|
||||||
output_path = os.path.join(COMPILE_DIR, file)
|
output_path = os.path.join(COMPILE_DIR, file)
|
||||||
@@ -465,6 +467,8 @@ def compile() -> None:
|
|||||||
etree.indent(compile_root, space=" " * 4)
|
etree.indent(compile_root, space=" " * 4)
|
||||||
compile_file.write(etree.tostring(compile_root, encoding=str, pretty_print=True))
|
compile_file.write(etree.tostring(compile_root, encoding=str, pretty_print=True))
|
||||||
|
|
||||||
|
pbar.update()
|
||||||
|
|
||||||
logger.info('Completed episode data compiling.')
|
logger.info('Completed episode data compiling.')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user