Add plugin for setting logging console

So that we are not tied to tqdm.
This commit is contained in:
James R. Barlow
2021-01-31 02:29:11 -08:00
parent 42c84531e4
commit b1da09f141
7 changed files with 42 additions and 12 deletions
+6
View File
@@ -8,6 +8,7 @@
from abc import ABC, abstractmethod, abstractstaticmethod
from argparse import ArgumentParser, Namespace
from collections import namedtuple
from logging import Handler
from pathlib import Path
from typing import TYPE_CHECKING, AbstractSet, Callable, Iterable, List, Optional
@@ -27,6 +28,11 @@ hookspec = pluggy.HookspecMarker('ocrmypdf')
# pylint: disable=unused-argument
@hookspec
def get_logging_console() -> Handler:
"""Returns a logging handler. Should be configured to handle progress bars."""
@hookspec
def add_options(parser: ArgumentParser) -> None:
"""Allows the plugin to add its own command line and API arguments.