Skip to content

Commit

Permalink
disable progressbar on close
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHardew committed Feb 14, 2024
1 parent 20ebff5 commit 6c94b66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/compress_comics_TheHardew/compress_comics.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ def error_handler(err):
move(output_file, base / input_file)
elif prog_args.overwrite_destination == 'True':
move(output_file, base / Path(prog_args.output_directory) / input_file.with_suffix('.cbz'))
pbar.close(text=statistics_string(original_size, compressed_size, input_file.name),
filled=True)
pbar.close(text=statistics_string(original_size, compressed_size, input_file.name))
except:
pool.terminate()
if Path(output_file).exists():
Expand Down Expand Up @@ -395,7 +394,7 @@ def compress_all_comics(prog_args, enc_args, directory):
pbar.update()

pbar.display('', 2)
pbar.close(text=statistics_string(original_size, compressed_size, 'Comic books'))
pbar.close(text=statistics_string(original_size, compressed_size, 'Comic books'), filled=True)


def main():
Expand Down
6 changes: 5 additions & 1 deletion src/compress_comics_TheHardew/text_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ def close(self, text=None, filled=False):
"""
if text:
self.text = text
self.bar_format = self.__custom_bar_format(filled)

if filled:
self.bar_format = self.__custom_bar_format(filled)
else:
self.bar_format = '{elapsed}| ' + self.text
tqdm.close(self)


Expand Down

0 comments on commit 6c94b66

Please sign in to comment.