winziprint.py: Make steps variable thread safe
This commit is contained in:
@ -52,12 +52,12 @@ def convert(input_files: list[str],
|
||||
|
||||
html_files = [file.lstrip('!') for file in input_files if not file.endswith('.pdf')]
|
||||
total_steps = len(html_files) + math.ceil(len(html_files) / BATCH_SIZE) + 1
|
||||
convert.steps = 0
|
||||
steps = [0]
|
||||
|
||||
def next_step() -> None:
|
||||
convert.steps += 1
|
||||
steps[0] += 1
|
||||
if progress:
|
||||
print(f'progress: {convert.steps}/{total_steps}', file=out, flush=True)
|
||||
print(f'progress: {steps[0]}/{total_steps}', file=out, flush=True)
|
||||
|
||||
try:
|
||||
tmp_page_nums = []
|
||||
|
Reference in New Issue
Block a user