Sort imports

This commit is contained in:
James R. Barlow
2019-12-19 15:31:18 -08:00
parent 8c5f8b8ddd
commit c5edff2c2f
29 changed files with 37 additions and 42 deletions
+2 -1
View File
@@ -21,10 +21,11 @@ import platform
import sys
from pathlib import Path
from subprocess import PIPE, run
from ocrmypdf import api, cli
import pytest
from ocrmypdf import api, cli
pytest_plugins = ['helpers_namespace']
try:
+1 -3
View File
@@ -25,14 +25,12 @@ import os
import sys
from subprocess import check_call
from gs import real_ghostscript
"""Replicate one type of Ghostscript feature elision warning during
PDF/A creation."""
from gs import real_ghostscript
elision_warning = """GPL Ghostscript 9.20: Setting Overprint Mode to 1
not permitted in PDF/A-2, overprint mode not set"""
+2 -2
View File
@@ -23,12 +23,12 @@
import os
import sys
from gs import real_ghostscript
"""Replicate Ghostscript PDF/A conversion failure by suppressing some
arguments"""
from gs import real_ghostscript
def main():
if '--version' in sys.argv:
+2 -3
View File
@@ -24,11 +24,10 @@
import os
import sys
"""Replicate Ghostscript raster failure while allowing rendering"""
from gs import real_ghostscript
"""Replicate Ghostscript raster failure while allowing rendering"""
def main():
if '--version' in sys.argv:
-1
View File
@@ -25,7 +25,6 @@
import os
import sys
from gs import real_ghostscript
-1
View File
@@ -22,7 +22,6 @@
import sys
"""Tesseract bad utf8 spoof
In 'hocr' mode or 'pdf' mode, return error code 1 and some non-Unicode
-1
View File
@@ -59,7 +59,6 @@ import subprocess
import sys
from pathlib import Path
__version__ = subprocess.check_output(
['tesseract', '--version'], stderr=subprocess.STDOUT
).decode()
-1
View File
@@ -19,7 +19,6 @@ import pytest
import ocrmypdf
check_ocrmypdf = pytest.helpers.check_ocrmypdf
+1 -1
View File
@@ -15,7 +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/>.
from subprocess import run, PIPE
from subprocess import PIPE, run
import pytest
-1
View File
@@ -18,7 +18,6 @@
import logging
from decimal import Decimal
import pikepdf
import pytest
from PIL import Image
+1 -1
View File
@@ -18,10 +18,10 @@
import os
from unittest.mock import patch
import pikepdf
import pytest
import ocrmypdf
import pikepdf
def test_no_glyphless_graft(resources, outdir):
+2 -2
View File
@@ -17,10 +17,10 @@
from unittest.mock import patch
import pytest
from PIL import Image
import img2pdf
import pikepdf
import pytest
from PIL import Image
import ocrmypdf
+1 -1
View File
@@ -16,8 +16,8 @@
# along with OCRmyPDF. If not, see <http://www.gnu.org/licenses/>.
from os import fspath
import os
from os import fspath
from pickle import dumps, loads
from unittest.mock import patch
+5 -5
View File
@@ -17,22 +17,22 @@
import datetime
from datetime import timezone
import logging
import mmap
from os import fspath
import os
from datetime import timezone
from os import fspath
from pathlib import Path
from shutil import copyfile, move
from unittest.mock import MagicMock, patch
import pytest
import pikepdf
import pytest
from pikepdf.models.metadata import decode_pdf_date
from ocrmypdf._jobcontext import PDFContext
from ocrmypdf.exceptions import ExitCode
from ocrmypdf.pdfa import SRGB_ICC_PROFILE, file_claims_pdfa, generate_pdfa_ps
from pikepdf.models.metadata import decode_pdf_date
try:
import fitz
+1 -1
View File
@@ -19,10 +19,10 @@ import logging
from os import fspath
from pathlib import Path
import pikepdf
import pytest
from PIL import Image
import pikepdf
from ocrmypdf import optimize as opt
from ocrmypdf.exec import jbig2enc, pngquant
from ocrmypdf.exec.ghostscript import rasterize_pdf
+1 -1
View File
@@ -19,8 +19,8 @@ import pytest
import ocrmypdf
from ocrmypdf._validation import _pages_from_ranges
from ocrmypdf.pdfinfo import PdfInfo
from ocrmypdf.exceptions import BadArgsError
from ocrmypdf.pdfinfo import PdfInfo
@pytest.mark.parametrize(
+1 -1
View File
@@ -20,11 +20,11 @@ from math import isclose
from tempfile import NamedTemporaryFile
import img2pdf
import pikepdf
import pytest
from PIL import Image
from reportlab.pdfgen.canvas import Canvas
import pikepdf
from ocrmypdf import pdfinfo
from ocrmypdf.pdfinfo import Colorspace, Encoding
+1 -1
View File
@@ -21,10 +21,10 @@ from os import fspath
from unittest.mock import Mock
import img2pdf
import pikepdf
import pytest
from PIL import Image
import pikepdf
from ocrmypdf import leptonica
from ocrmypdf.exec import ghostscript, tesseract
from ocrmypdf.pdfinfo import PdfInfo
+1 -1
View File
@@ -18,7 +18,7 @@
import os
import sys
from pathlib import Path
from subprocess import DEVNULL, PIPE, run, Popen, CalledProcessError
from subprocess import DEVNULL, PIPE, CalledProcessError, Popen, run
import pytest
+1 -1
View File
@@ -20,8 +20,8 @@ from unittest.mock import patch
import pytest
from ocrmypdf.cli import parser
from ocrmypdf._validation import check_options
from ocrmypdf.cli import parser
from ocrmypdf.exceptions import ExitCode, MissingDependencyError
from ocrmypdf.exec import unpaper
+1 -1
View File
@@ -23,7 +23,7 @@ import pytest
import ocrmypdf._validation as vd
from ocrmypdf.api import create_options
from ocrmypdf.exceptions import MissingDependencyError, BadArgsError
from ocrmypdf.exceptions import BadArgsError, MissingDependencyError
from ocrmypdf.pdfinfo import PdfInfo