Skip to content

Commit 1b8a6ca

Browse files
committed
connections: print progress after completion
Since the progress indicators shows percent complete, we should do this *after* it is actually complete.
1 parent 7d1ecd6 commit 1b8a6ca

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
### Changed
9+
- Print BLE download progress after chunk is complete instead of before.
10+
711
## [1.0.0-alpha.2] - 2021-04-08
812
### Added
913
- Check Pybricks protocol version when connecting to Bluetooth Low Energy devices.

pybricksdev/connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ async def run(self, py_path, wait=True, print_output=True):
749749
# Send the data chunk by chunk
750750
print(f"Downloading {len(mpy)} bytes in {len(chunks)} steps.")
751751
for i, chunk in enumerate(chunks):
752-
print(f"Progress: {round((i + 1) / len(chunks) * 100)}%")
753752
await self.send_block(chunk)
753+
print(f"Progress: {round((i + 1) / len(chunks) * 100)}%")
754754
finally:
755755
self.loading = False
756756

0 commit comments

Comments
 (0)