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 - host_test
dependencies: [] dependencies: []
before_script: before_script:
- pip install --upgrade pip
- pip install -e .[dev] --prefer-binary - pip install -e .[dev] --prefer-binary
version_check: version_check:

View File

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

View File

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