Skip to content

Commit b47c2d2

Browse files
committed
feat: print more stats message
1 parent 8415e58 commit b47c2d2

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.2.0] - 2025-05-21
9+
10+
### Added
11+
- Enhanced Flash Task Summary Report with:
12+
- Total flashing time statistics
13+
- Detailed flash parameters (baud rate, chip type, flash options)
14+
- Binary file information (address, path, size)
15+
- Improved device statistics display
16+
17+
### Changed
18+
- Improved summary report formatting with emoji icons for better readability
19+
- Reorganized summary report sections for better information hierarchy
20+
21+
### Fixed
22+
- None
23+
24+
### Security
25+
- None

esp_batch_flash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
ESP Batch Flash - A tool for flashing multiple ESP32 devices in parallel
33
"""
44

5-
__version__ = "0.1.0"
5+
__version__ = "0.2.0"

esp_batch_flash/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ def flash_device(device, flash_options, binary_files, log_dir, chip_type='auto',
480480
print(f"=========================================")
481481
print(f"Flashing to {device}... (Log: {log_file})")
482482
print(f"=========================================")
483+
# Add empty lines to create a buffer space for progress bar updates
484+
print("\n\n\n\n\n")
483485

484486
# Construct the esptool command
485487
cmd = [sys.executable, "-m", "esptool", "--chip", chip_type, "--port", device, "--baud", str(baud_rate), "write_flash"]

esp_batch_flash/cli.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ def main():
230230
# Process devices in parallel
231231
print(f"Starting parallel flashing process (max {args.max_parallel} concurrent tasks)...")
232232

233+
# Record start time
234+
start_time = time.time()
235+
233236
# Clear any previous progress information, ensure no duplicate progress bars
234237
with progress_lock:
235238
device_progress.clear() # Add this line to ensure clearing progress data before each run
@@ -300,11 +303,28 @@ def main():
300303
# Count total devices
301304
total_devices = len(usb_devices)
302305

306+
# Calculate total time
307+
total_time = time.time() - start_time
308+
minutes = int(total_time // 60)
309+
seconds = int(total_time % 60)
310+
303311
# Print summary report
304312
print()
305313
print("========================================")
306314
print("📊 Flash Task Summary Report")
307315
print("========================================")
316+
print(f"⏱️ Total Time: {minutes} minutes {seconds} seconds")
317+
print()
318+
print(f"🔧 Flash Parameters:")
319+
print(f" - Baud Rate: {args.baud}")
320+
print(f" - Chip Type: {args.chip}")
321+
print(f" - Flash Options: {' '.join(flash_options)}")
322+
print()
323+
print(f"📦 Binary Files:")
324+
for addr, path in binary_files:
325+
size = os.path.getsize(path)
326+
print(f" - {addr}: {path} ({size:,} bytes)")
327+
print()
308328
print(f"🔍 Total devices: {total_devices}")
309329
print(f"✅ Success count: {success_count}")
310330
print(f"❌ Failed count: {failed_count}")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name="esp-batch-flash",
11-
version="0.1.0",
11+
version="0.2.0",
1212
author="leeebo",
1313
author_email="liboogo@gmail.com",
1414
description="A tool for parallel flashing multiple ESP32 devices",

0 commit comments

Comments
 (0)