Update terminal_helper.py

This commit is contained in:
zandercymatics 2025-03-13 11:44:26 -06:00
parent 5d8bc1c638
commit d894ee2e70
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -204,8 +204,34 @@ class TerminalHelper:
failed_header=None, failed_header=None,
display_as_str=False, display_as_str=False,
): ):
"""Prints success, failed, and skipped counts, as well as """Generates a formatted summary of script execution results with colored output.
all affected objects."""
Displays counts and details of successful, failed, and skipped operations.
In debug mode or when prompted, shows full record details.
Uses color coding: green for success, yellow for skipped, red for failures.
Args:
to_update: Records that were successfully updated
failed_to_update: Records that failed to update
skipped: Records that were intentionally skipped
to_add: Records that were newly added
debug: If True, shows detailed record information
log_header: Custom header for the summary (default: "FINISHED")
skipped_header: Custom header for skipped records section
failed_header: Custom header for failed records section
display_as_str: If True, converts records to strings for display
Output Format:
[Header]
Added: X entries
Updated: Y entries
Skipped: Z entries
Failed: W entries
Debug output (if enabled):
- Full record details for each category
- Color coded by operation type
"""
add_count = len(to_add) add_count = len(to_add)
update_count = len(to_update) update_count = len(to_update)
skipped_count = len(skipped) skipped_count = len(skipped)