6.23.10.2.16.2. Print diff table

Print out a diff table with side by side comparison of files. Requires the diff module. No table is generated if the files compare equal.
Comienzo python section to interscript/frames/inputf.py[21 /41 ] Siguiente Previo Primero Ăšltimo
   646: #line 903 "input_frame.ipk"
   647:   def print_diff_table(self, comparison,
   648:     actual_heading='Actual', expected_heading='Expected',
   649:     ok_message='Data compared equal.',
   650:     diff_message='Differential follows.'):
   651: 
   652:     equal = len(comparison) == 0
   653:     our_weaver = self.get_weaver()
   654:     if not equal:
   655:       if diff_message:
   656:         our_weaver.writeline(diff_message)
   657:       our_weaver.begin_table('Actual','Expected', CLASS='DIFF')
   658:       for section in comparison:
   659:         left = section[0][1:]
   660:         right = section[1][1:]
   661:         left = string.join(left,'\n')
   662:         right = string.join(right,'\n')
   663:         our_weaver.table_row([left, right])
   664:       our_weaver.end_table()
   665:     else:
   666:       if ok_message:
   667:         our_weaver.writeline(ok_message)
   668: 
End python section to interscript/frames/inputf.py[21]