Refactor tesseract_env variable into the plugin

Removed all cases except one in api.py, which isn't worth solving because
it should be removed anyway.

This also fixes a logic error in the OMP_THREAD_LIMIT decision, api.py
did not use pass kwargs correctly so they never worked before.
This commit is contained in:
James R. Barlow
2020-05-26 02:14:06 -07:00
parent d43212d30b
commit aa060db5bc
7 changed files with 42 additions and 37 deletions
+4 -1
View File
@@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with OCRmyPDF. If not, see <http://www.gnu.org/licenses/>.
import argparse
import importlib
import importlib.util
import sys
@@ -50,7 +51,9 @@ def get_plugin_manager(plugins: List[str], builtins=True):
return pm
def get_parser_options_plugins(args):
def get_parser_options_plugins(
args,
) -> (argparse.ArgumentParser, argparse.Namespace, pluggy.PluginManager):
pre_options, _unused = plugins_only_parser.parse_known_args(args=args)
plugin_manager = get_plugin_manager(pre_options.plugins)