Refactor concurrency so that it is pluggable
However, this may not be the best idea because it involves global state that could be overridden by a parallel call to ocrmypdf.ocr.
This commit is contained in:
@@ -32,7 +32,11 @@ class OcrmypdfPluginManager(pluggy.PluginManager):
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, *args, plugins: List[Union[str, Path]], builtins: bool = True, **kwargs,
|
||||
self,
|
||||
*args,
|
||||
plugins: List[Union[str, Path]],
|
||||
builtins: bool = True,
|
||||
**kwargs,
|
||||
):
|
||||
self.__init_args = args
|
||||
self.__init_kwargs = kwargs
|
||||
@@ -88,7 +92,9 @@ class OcrmypdfPluginManager(pluggy.PluginManager):
|
||||
|
||||
def get_plugin_manager(plugins: List[Union[str, Path]], builtins=True):
|
||||
pm = OcrmypdfPluginManager(
|
||||
project_name='ocrmypdf', plugins=plugins, builtins=builtins,
|
||||
project_name='ocrmypdf',
|
||||
plugins=plugins,
|
||||
builtins=builtins,
|
||||
)
|
||||
return pm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user