1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 10:16:39 +00:00

Minor changes.

This commit is contained in:
Pablo Curiel 2021-03-16 00:25:19 -04:00
parent e70979248a
commit 97cd7eb53e
2 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
build
__pycache__
dist
nxdumptool
*.elf
*.nacp
*.nro

View file

@ -567,8 +567,8 @@ def usbHandleSendFileProperties(cmd_block):
blksize = USB_TRANSFER_BLOCK_SIZE
# Initialize progress bar.
(unit, unit_divisor) = utilsGetSizeUnitAndDivisor(file_size)
total = (float(file_size) / unit_divisor)
(unit, unit_divider) = utilsGetSizeUnitAndDivisor(file_size)
total = (float(file_size) / unit_divider)
idx = filename.rfind(os.path.sep)
prefix_filename = (filename[idx+1:] if (idx >= 0) else filename)
@ -616,7 +616,7 @@ def usbHandleSendFileProperties(cmd_block):
if chunk_size == USB_CMD_HEADER_SIZE:
(magic, cmd_id, cmd_block_size) = struct.unpack_from('<4sII', chunk, 0)
if (magic == USB_MAGIC_WORD) and (cmd_id == USB_CMD_CANCEL_FILE_TRANSFER):
g_Logger.debug('Received CancelFileTransfer (%02X) command.' % (USB_CMD_CANCEL_FILE_TRANSFER))
g_Logger.debug('\nReceived CancelFileTransfer (%02X) command.' % (USB_CMD_CANCEL_FILE_TRANSFER))
# Cancel file transfer.
cancelTransfer()
@ -636,8 +636,7 @@ def usbHandleSendFileProperties(cmd_block):
g_nspRemainingSize = (g_nspRemainingSize - chunk_size)
# Update progress bar once per second.
pbar.update(float(chunk_size) / unit_divisor)
#pbar.refresh()
pbar.update(float(chunk_size) / unit_divider)
elapsed_time = round(time.time() - pbar.start)
g_Logger.info('File transfer successfully completed in %s!\n' % (tqdm.format_interval(elapsed_time)))