Skip to content

Commit

Permalink
fix f-strings, release v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Feb 2, 2022
1 parent d67abac commit 3cc9a5f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion okdmr/dmrlib/etsi/crc/crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, configuration: Union[BitCrcConfiguration, enum.Enum]):
configuration = configuration.value
assert isinstance(
configuration, BitCrcConfiguration
), f"BitCrcConfiguration not provided, got ${type(configuration)} instead"
), f"BitCrcConfiguration not provided, got {type(configuration)} instead"
self._topbit: bitarray = bitarray([1]) + bitarray(
[0] * (configuration.width_bits - 1)
)
Expand Down
2 changes: 1 addition & 1 deletion okdmr/dmrlib/etsi/crc/crc16.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def check(data: bytes, crc16: int, mask: CrcMasks) -> bool:
"""
assert (
0x0000 <= crc16 <= 0xFFFF
), f"CRC16 is expected in range (exclusive) 0-${0xFFFF}, got ${crc16}"
), f"CRC16 is expected in range (exclusive) 0-{0xFFFF}, got {crc16}"

return CRC16.calculate(data, mask) == crc16

Expand Down
2 changes: 1 addition & 1 deletion okdmr/dmrlib/etsi/crc/crc32.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check(data: bytes, crc32: int) -> bool:
"""
assert (
0x00000000 <= crc32 <= 0xFFFFFFFF
), f"CRC32 is expected in range (exclusive) 0-4294967295, got ${crc32}"
), f"CRC32 is expected in range (exclusive) 0-{0xFFFFFFFF}, got {crc32}"

return CRC32.calculate(data) == crc32

Expand Down
2 changes: 1 addition & 1 deletion okdmr/tests/dmrlib/etsi/crc/test_crc16.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_crc16():
data=bytes.fromhex(databytes),
crc16=int.from_bytes(bytes.fromhex(crc32), byteorder="big"),
mask=crc_mask,
), f"CRC16 does not match in ${(databytes, crc32, crc_mask)}"
), f"CRC16 does not match in {(databytes, crc32, crc_mask)}"
2 changes: 1 addition & 1 deletion okdmr/tests/dmrlib/etsi/crc/test_crc32.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def test_crc32():
assert CRC32.check(
data=bytes.fromhex(databytes),
crc32=int.from_bytes(bytes.fromhex(expected_crc32), byteorder="little"),
), f"CRC32 does not match in ${(databytes, expected_crc32)}"
), f"CRC32 does not match in {(databytes, expected_crc32)}"
2 changes: 1 addition & 1 deletion okdmr/tests/dmrlib/etsi/crc/test_crc9.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_crc9():
serial_number=serialno,
crc9=expected_crc9,
crc32=bytes.fromhex(crc32) if crc32 else None,
), f"CRC9 does not match in ${(databytes, serialno, expected_crc9, mask, crc32)}"
), f"CRC9 does not match in {(databytes, serialno, expected_crc9, mask, crc32)}"


def test_crc9_table():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
author="Marek Sebera",
author_email="[email protected]",
license="AGPL-3.0",
version="0.1",
version="0.2",
packages=[
"okdmr.dmrlib",
"okdmr.dmrlib.transmission",
Expand Down

0 comments on commit 3cc9a5f

Please sign in to comment.