Delinting
This commit is contained in:
@@ -189,7 +189,7 @@ def worker_init(queue):
|
||||
root.addHandler(h)
|
||||
|
||||
|
||||
def worker_thread_init(queue):
|
||||
def worker_thread_init(_queue):
|
||||
pass
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ def exec_concurrent(context):
|
||||
class NeverRaise(Exception):
|
||||
"""An exception that is never raised"""
|
||||
|
||||
pass
|
||||
pass # pylint: disable=unnecessary-pass
|
||||
|
||||
|
||||
def run_pipeline(options, api=False):
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from collections import namedtuple
|
||||
from contextlib import suppress
|
||||
from functools import lru_cache
|
||||
from os import fspath
|
||||
from subprocess import PIPE, STDOUT, CalledProcessError, TimeoutExpired, run
|
||||
|
||||
|
||||
@@ -549,11 +549,11 @@ def main(infile, outfile, level, jobs=1):
|
||||
"""Emulate ocrmypdf's options"""
|
||||
|
||||
def __init__(
|
||||
self, input_file, jobs, optimize, jpeg_quality, png_quality, jb2lossy
|
||||
self, input_file, jobs, optimize_, jpeg_quality, png_quality, jb2lossy
|
||||
):
|
||||
self.input_file = input_file
|
||||
self.jobs = jobs
|
||||
self.optimize = optimize
|
||||
self.optimize = optimize_
|
||||
self.jpeg_quality = jpeg_quality
|
||||
self.png_quality = png_quality
|
||||
self.jbig2_page_group_size = 0
|
||||
@@ -564,7 +564,7 @@ def main(infile, outfile, level, jobs=1):
|
||||
options = OptimizeOptions(
|
||||
input_file=infile,
|
||||
jobs=jobs,
|
||||
optimize=int(level),
|
||||
optimize_=int(level),
|
||||
jpeg_quality=0, # Use default
|
||||
png_quality=0,
|
||||
jb2lossy=False,
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ def test_skip_ocr(spoof_tesseract_cache, resources, outpdf):
|
||||
assert pdfinfo[0].has_text
|
||||
|
||||
|
||||
def test_redo_ocr(spoof_tesseract_cache, resources, outpdf):
|
||||
def test_redo_ocr(resources, outpdf):
|
||||
in_ = resources / 'graph_ocred.pdf'
|
||||
before = PdfInfo(in_, detailed_page_analysis=True)
|
||||
out = outpdf
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with OCRmyPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch, call
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -135,6 +135,7 @@ def test_no_progress_bar(progress_bar, resources):
|
||||
with patch('ocrmypdf.pdfinfo.info.tqdm', autospec=True) as tqdmpatch:
|
||||
vd.check_options(opts)
|
||||
pdfinfo = PdfInfo(opts.input_file, progbar=opts.progress_bar)
|
||||
assert pdfinfo is not None
|
||||
assert tqdmpatch.called
|
||||
_args, kwargs = tqdmpatch.call_args
|
||||
assert kwargs['disable'] != progress_bar
|
||||
|
||||
Reference in New Issue
Block a user