Skip to content

Commit

Permalink
Use %r instead of repr()
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed May 6, 2021
1 parent 8ad6dba commit 2c352be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions adb_shell/adb_device.py
Expand Up @@ -813,7 +813,7 @@ def _read_length(self, data_length, data_checksum, adb_info):
if data_length > 0:
while data_length > 0:
temp = self._transport.bulk_read(data_length, adb_info.transport_timeout_s)
_LOGGER.debug("bulk_read(%d): %.1000s", data_length, repr(temp))
_LOGGER.debug("bulk_read(%d): %.1000r", data_length, temp)

data += temp
data_length -= len(temp)
Expand Down Expand Up @@ -865,7 +865,7 @@ def _read(self, expected_cmds, adb_info):

while True:
msg = self._transport.bulk_read(constants.MESSAGE_SIZE, adb_info.transport_timeout_s)
_LOGGER.debug("bulk_read(%d): %s", constants.MESSAGE_SIZE, repr(msg))
_LOGGER.debug("bulk_read(%d): %r", constants.MESSAGE_SIZE, msg)
cmd, arg0, arg1, data_length, data_checksum = unpack(msg)
command = constants.WIRE_TO_ID.get(cmd)

Expand Down Expand Up @@ -989,11 +989,11 @@ def _send(self, msg, adb_info):
"""
packed = msg.pack()
_LOGGER.debug("bulk_write(%d): %s", len(packed), repr(packed))
_LOGGER.debug("bulk_write(%d): %r", len(packed), packed)
self._transport.bulk_write(packed, adb_info.transport_timeout_s)

if msg.data:
_LOGGER.debug("bulk_write(%d): %s", len(msg.data), repr(msg.data))
_LOGGER.debug("bulk_write(%d): %r", len(msg.data), msg.data)
self._transport.bulk_write(msg.data, adb_info.transport_timeout_s)

def _streaming_command(self, service, command, adb_info):
Expand Down
8 changes: 4 additions & 4 deletions adb_shell/adb_device_async.py
Expand Up @@ -809,7 +809,7 @@ async def _read_length(self, data_length, data_checksum, adb_info):
if data_length > 0:
while data_length > 0:
temp = await self._transport.bulk_read(data_length, adb_info.transport_timeout_s)
_LOGGER.debug("bulk_read(%d): %.1000s", data_length, repr(temp))
_LOGGER.debug("bulk_read(%d): %.1000r", data_length, temp)

data += temp
data_length -= len(temp)
Expand Down Expand Up @@ -861,7 +861,7 @@ async def _read(self, expected_cmds, adb_info):

while True:
msg = await self._transport.bulk_read(constants.MESSAGE_SIZE, adb_info.transport_timeout_s)
_LOGGER.debug("bulk_read(%d): %s", constants.MESSAGE_SIZE, repr(msg))
_LOGGER.debug("bulk_read(%d): %r", constants.MESSAGE_SIZE, msg)
cmd, arg0, arg1, data_length, data_checksum = unpack(msg)
command = constants.WIRE_TO_ID.get(cmd)

Expand Down Expand Up @@ -985,11 +985,11 @@ async def _send(self, msg, adb_info):
"""
packed = msg.pack()
_LOGGER.debug("bulk_write(%d): %s", len(packed), repr(packed))
_LOGGER.debug("bulk_write(%d): %r", len(packed), packed)
await self._transport.bulk_write(msg.pack(), adb_info.transport_timeout_s)

if msg.data:
_LOGGER.debug("bulk_write(%d): %s", len(msg.data), repr(msg.data))
_LOGGER.debug("bulk_write(%d): %r", len(msg.data), msg.data)
await self._transport.bulk_write(msg.data, adb_info.transport_timeout_s)

async def _streaming_command(self, service, command, adb_info):
Expand Down

0 comments on commit 2c352be

Please sign in to comment.