2929}
3030
3131
32- def _print_summary_box (title , lines ):
33- """Prints a formatted box for summarizing build results ."""
32+ def _print_box (title , lines ):
33+ """Prints a formatted box with a title and lines ."""
3434 box_width = 80
3535 title_line = f'║ { title .center (box_width - 4 )} ║'
3636 summary_lines = [
@@ -39,9 +39,7 @@ def _print_summary_box(title, lines):
3939 '╠' + '═' * (box_width - 2 ) + '╣' ,
4040 ]
4141 for line in lines :
42- wrapped_lines = textwrap .wrap (line , box_width - 6 )
43- for i , sub_line in enumerate (wrapped_lines ):
44- summary_lines .append (f'║ { sub_line .ljust (box_width - 6 )} ║' )
42+ summary_lines .append (f'║ { line .ljust (box_width - 4 )} ║' )
4543 summary_lines .append ('╚' + '═' * (box_width - 2 ) + '╝' )
4644 print ('\n ' .join (summary_lines ))
4745
@@ -51,13 +49,17 @@ def generate_final_summary(all_results):
5149 summary_lines = []
5250 for version , data in all_results .items ():
5351 if data :
52+ passed = str (data ['successful' ])
53+ failed = str (data ['failed' ])
54+ skipped = str (data ['skipped' ])
55+ total = str (data ['total' ])
5456 line = (
55- f" { version .ljust (15 )} ► Passed: { data [ 'successful' ] } | "
56- f"Failed: { data [ ' failed' ] } | Skipped: { data [ ' skipped' ] } | "
57- f"Total: { data [ ' total' ] } " )
57+ f" { version .ljust (15 )} ► Passed: { passed . ljust ( 2 ) } | "
58+ f"Failed: { failed . ljust ( 2 ) } | Skipped: { skipped . ljust ( 2 ) } | "
59+ f"Total: { total . ljust ( 2 ) } " )
5860 summary_lines .append (line )
5961
60- _print_summary_box ('FINAL BUILD REPORT' , summary_lines )
62+ _print_box ('FINAL BUILD REPORT' , summary_lines )
6163
6264
6365def generate_comparison_table (all_results ):
@@ -71,12 +73,10 @@ def generate_comparison_table(all_results):
7173 print ('\n ✅ No projects were run.' )
7274 return
7375
74- table_rows = []
75- header = ('Project' .ljust (20 ) + '| ' + 'Legacy' .center (15 ) + '| ' +
76- 'Ubuntu 20.04' .center (15 ) + '| ' + 'Ubuntu 24.04' .center (15 ))
76+ header = ('Project' .ljust (20 ) + ' | ' + 'Legacy' .center (15 ) + ' | ' +
77+ 'Ubuntu 20.04' .center (15 ) + ' | ' + 'Ubuntu 24.04' .center (15 ))
7778 separator = ('-' * 21 + '+' + '-' * 17 + '+' + '-' * 17 + '+' + '-' * 17 )
78- table_rows .append (header )
79- table_rows .append (separator )
79+ table_lines = [header , separator ]
8080
8181 for project in sorted (list (all_projects )):
8282 row_parts = [f' { project .ljust (19 )} ' ]
@@ -90,9 +90,9 @@ def generate_comparison_table(all_results):
9090 else :
9191 status_icon = '✅'
9292 row_parts .append (f' { status_icon .center (15 )} ' )
93- table_rows .append ('|' .join (row_parts ))
93+ table_lines .append ('|' .join (row_parts ))
9494
95- _print_summary_box ('FAILURE COMPARISON TABLE' , table_rows )
95+ _print_box ('FAILURE COMPARISON TABLE' , table_lines )
9696
9797
9898def main ():
@@ -126,4 +126,4 @@ def main():
126126
127127
128128if __name__ == '__main__' :
129- main ()
129+ main ()
0 commit comments