refactor(style): Comply with black>=24.0.0

This commit is contained in:
radim.karnis
2024-01-30 10:05:36 +01:00
parent 79978c0f64
commit 5ad3c481f3
3 changed files with 18 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ cache:
- host_test
dependencies: []
before_script:
- pip install --upgrade pip
- pip install -e .[dev] --prefer-binary
version_check:

View File

@@ -815,9 +815,11 @@ def image_info(args):
print(
"Checksum: {:#02x} ({})".format(
image.checksum,
"valid"
if image.checksum == calc_checksum
else "invalid - calculated {:02x}".format(calc_checksum),
(
"valid"
if image.checksum == calc_checksum
else "invalid - calculated {:02x}".format(calc_checksum)
),
)
)
try:
@@ -941,9 +943,11 @@ def image_info(args):
print(
"Checksum: {:02x} ({})".format(
image.checksum,
"valid"
if image.checksum == calc_checksum
else "invalid - calculated {:02x}".format(calc_checksum),
(
"valid"
if image.checksum == calc_checksum
else "invalid - calculated {:02x}".format(calc_checksum)
),
)
)
try:

View File

@@ -1651,12 +1651,14 @@ class HexFormatter(object):
while len(s) > 0:
line = s[:16]
ascii_line = "".join(
c
if (
c == " "
or (c in string.printable and c not in string.whitespace)
(
c
if (
c == " "
or (c in string.printable and c not in string.whitespace)
)
else "."
)
else "."
for c in line.decode("ascii", "replace")
)
s = s[16:]