mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-13 22:54:46 -04:00
BIOSUtilities v24.10.18
Removed all Python built-in library keyword arguments (#55)
This commit is contained in:
parent
010b5a47d4
commit
35455f735c
27 changed files with 228 additions and 229 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue