BIOSUtilities v24.10.18

Removed all Python built-in library keyword arguments (#55)
This commit is contained in:
Plato Mavropoulos 2024-10-18 13:37:52 +03:00
parent 010b5a47d4
commit 35455f735c
27 changed files with 228 additions and 229 deletions

View file

@ -38,7 +38,7 @@ def file_to_bytes(in_object: str | bytes | bytearray) -> bytes:
""" Get bytes from given buffer or file path """
if not isinstance(in_object, (bytes, bytearray)):
with open(file=to_string(in_object=in_object), mode='rb') as object_data:
with open(to_string(in_object=in_object), 'rb') as object_data:
object_bytes: bytes = object_data.read()
else:
object_bytes = in_object
@ -50,7 +50,7 @@ def bytes_to_hex(in_buffer: bytes, order: str, data_len: int, slice_len: int | N
""" Converts bytes to hex string, controlling endianess, data size and string slicing """
# noinspection PyTypeChecker
return f'{int.from_bytes(bytes=in_buffer, byteorder=order):0{data_len * 2}X}'[:slice_len] # type: ignore
return f'{int.from_bytes(in_buffer, byteorder=order):0{data_len * 2}X}'[:slice_len] # type: ignore
def remove_quotes(in_text: str) -> str: