Fix JBIG2 not updating progress bar

This commit is contained in:
James R. Barlow
2023-11-20 16:25:30 -08:00
parent 03669183d7
commit 8a73ed5d5a
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -8,7 +8,7 @@ from __future__ import annotations
import threading
from abc import ABC, abstractmethod
from collections.abc import Iterable
from typing import Callable, TypeVar
from typing import Any, Callable, TypeVar
from ocrmypdf._progressbar import NullProgressBar, ProgressBar
@@ -19,6 +19,10 @@ def _task_noop(*_args, **_kwargs):
return
def _task_finished_noop(_result: Any, pbar: ProgressBar):
pbar.update()
class Executor(ABC):
"""Abstract concurrent executor."""
@@ -66,7 +70,7 @@ class Executor(ABC):
if not worker_initializer:
worker_initializer = _task_noop
if not task_finished:
task_finished = _task_noop
task_finished = _task_finished_noop
if not task:
task = _task_noop