Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/infuse_iot/tools/data_logger_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def add_parser(cls, parser):
def progress_table(self):
table = Table()
table.add_column("Device ID")
table.add_column("On Disk")
table.add_column("On Device")
table.add_column("Downloaded")
table.add_column("On Disk", justify="right")
table.add_column("On Device", justify="right")
table.add_column("Downloaded", justify="right")
for device, state in self._device_state.items():
on_device = str(state.on_device) if state.on_device is not None else "?"
table.add_row(f"{device:016x}", str(state.on_disk), on_device, str(state.downloaded))
percent = f"{100 * state.on_disk / state.on_device:.0f}" if state.on_device is not None else "?"
table.add_row(f"{device:016x}", f"{state.on_disk} ({percent:>3s}%)", on_device, str(state.downloaded))

meta = Table(box=None)
meta.add_column()
Expand Down Expand Up @@ -180,8 +181,10 @@ def run(self):
self.state_update(live, "Scanning")
if self._app and announce.application != self._app:
continue
if announce.flags & 0x01:
# Skip data on removable loggers
# Don't consider announce packets that don't contain information about the requested logger
req_removable = self._logger == rpc_enum_data_logger.FLASH_REMOVABLE
announce_is_removable = announce.flags & 0x01
if req_removable != announce_is_removable:
continue

if source.infuse_id not in self._device_state:
Expand Down