1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 18:26: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 build
__pycache__ __pycache__
dist dist
nxdumptool
*.elf *.elf
*.nacp *.nacp
*.nro *.nro

View file

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