[Git][reproducible-builds/diffoscope][master] 4 commits: Inline the RequiredToolNotFound.get_package method; only used once.
Chris Lamb
gitlab at salsa.debian.org
Thu Mar 5 21:36:25 UTC 2020
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
889e10f0 by Chris Lamb at 2020-03-05T13:21:41-08:00
Inline the RequiredToolNotFound.get_package method; only used once.
- - - - -
63983c2f by Chris Lamb at 2020-03-05T13:25:09-08:00
Weaken "Install the X package to get a better output" claim to "... may produce a better output".
- - - - -
bf52b1b0 by Chris Lamb at 2020-03-05T13:28:27-08:00
Drop deprecated "py36 = [..]" argument in pyproject.toml.
- - - - -
e4712c86 by Chris Lamb at 2020-03-05T13:29:29-08:00
Print a potentially-helpful message if the PyPDF2 module is not installed (re. #reproducible-builds/diffoscope#92)
- - - - -
3 changed files:
- diffoscope/comparators/pdf.py
- diffoscope/exc.py
- pyproject.toml
Changes:
=====================================
diffoscope/comparators/pdf.py
=====================================
@@ -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),
=====================================
diffoscope/exc.py
=====================================
@@ -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)
=====================================
pyproject.toml
=====================================
@@ -1,6 +1,5 @@
[tool.black]
line-length = 79
-py36 = true
skip-string-normalization = true
include = '(diffoscope|tests)/.+\.pyi?$'
exclude = "diffoscope/changes.py"
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/5840c56f5591f6eed4426b8a79cd5cd8661f2be5...e4712c86da8bb355d8af02e1ba77fd664d7dfca4
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/5840c56f5591f6eed4426b8a79cd5cd8661f2be5...e4712c86da8bb355d8af02e1ba77fd664d7dfca4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200305/259c50b4/attachment.htm>
More information about the rb-commits
mailing list