Commits (4)
......@@ -45,7 +45,11 @@ class PdfFile(File):
def compare_details(self, other, source=None):
xs = []
if PyPDF2 is not None:
if PyPDF2 is None:
self._comments.append(
"Installing the 'PyPDF2' package may produce a better output."
)
else:
difference = Difference.from_text(
self.dump_pypdf2_metadata(self),
self.dump_pypdf2_metadata(other),
......
......@@ -31,19 +31,18 @@ class RequiredToolNotFound(Exception):
def __init__(self, command):
self.command = get_tool_name(command)
def get_package(self):
return get_package_provider(self.command)
def get_comment(self, infix=''):
xs = [
"'{}' not available in path.".format(self.command),
infix,
]
x = self.get_package()
x = get_package_provider(self.command)
if x:
xs.append(
"Install the '{}' package to get a better output.".format(x)
"Installing the '{}' package may produce a better output.".format(
x
)
)
return " ".join(x for x in xs if x)
......
[tool.black]
line-length = 79
py36 = true
skip-string-normalization = true
include = '(diffoscope|tests)/.+\.pyi?$'
exclude = "diffoscope/changes.py"