Print formatted error box
(self, title: str, error_msg: str)
| 665 | print(header) |
| 666 | |
| 667 | def print_error_box(self, title: str, error_msg: str): |
| 668 | """Print formatted error box""" |
| 669 | print( |
| 670 | f"\n{Colors.FAIL}╔══════════════════════════════════════════════════════════════╗" |
| 671 | ) |
| 672 | print(f"║ {Colors.BOLD}ERROR: {title:<50}{Colors.FAIL} ║") |
| 673 | print("╠══════════════════════════════════════════════════════════════╣") |
| 674 | |
| 675 | words = error_msg.split() |
| 676 | lines = [] |
| 677 | current_line = "" |
| 678 | |
| 679 | for word in words: |
| 680 | if len(current_line + word) <= 54: |
| 681 | current_line += word + " " |
| 682 | else: |
| 683 | lines.append(current_line.strip()) |
| 684 | current_line = word + " " |
| 685 | if current_line: |
| 686 | lines.append(current_line.strip()) |
| 687 | |
| 688 | for line in lines: |
| 689 | print(f"║ {line:<56} ║") |
| 690 | |
| 691 | print( |
| 692 | f"╚══════════════════════════════════════════════════════════════╝{Colors.ENDC}" |
| 693 | ) |
| 694 | |
| 695 | def cleanup_cache(self): |
| 696 | """清理Python缓存文件 / Clean up Python cache files""" |
no outgoing calls
no test coverage detected