From a3c49b8f316fa51be0eb06e6c3f88672e7b7ee81 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 14 Apr 2023 02:19:19 -0700 Subject: [PATCH] ruff: more lint --- src/ocrmypdf/exceptions.py | 5 +++-- src/ocrmypdf/extra_plugins/__init__.py | 6 ++++++ tests/__init__.py | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ocrmypdf/exceptions.py b/src/ocrmypdf/exceptions.py index b56e8a1a..3db7328f 100644 --- a/src/ocrmypdf/exceptions.py +++ b/src/ocrmypdf/exceptions.py @@ -35,6 +35,7 @@ class ExitCodeException(Exception): message = "" def __str__(self): + """Return a string representation of the exception.""" super_msg = super().__str__() # Don't do str(super()) if self.message: return self.message.format(super_msg) @@ -94,7 +95,7 @@ class EncryptedPdfError(ExitCodeException): exit_code = ExitCode.encrypted_pdf message = dedent( - '''\ + """\ Input PDF is encrypted. The encryption must be removed to perform OCR. @@ -103,7 +104,7 @@ class EncryptedPdfError(ExitCodeException): You can remove the encryption using qpdf --decrypt [--password=[password]] infilename - ''' + """ ) diff --git a/src/ocrmypdf/extra_plugins/__init__.py b/src/ocrmypdf/extra_plugins/__init__.py index 079cf307..abfdfbbb 100644 --- a/src/ocrmypdf/extra_plugins/__init__.py +++ b/src/ocrmypdf/extra_plugins/__init__.py @@ -1,3 +1,9 @@ # SPDX-FileCopyrightText: 2022 James R. Barlow # # SPDX-License-Identifier: MPL-2.0 + +"""Extra plugins. These are not automatically inserted when ocrmypdf is run. + +You can use these plugins by specifying them on the command line, e.g.: +ocrmypdf --plugin ocrmypdf.extra_plugins.semfree ... +""" diff --git a/tests/__init__.py b/tests/__init__.py index 7b419d3f..4252e926 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,6 @@ # SPDX-FileCopyrightText: 2022 James R. Barlow # SPDX-License-Identifier: MPL-2.0 +"""Tests.""" + from __future__ import annotations