For producing HTML side by side comparison with change highlights.
This class can be used to create an HTML table (or a complete HTML file containing the table) showing a side by side, line by line comparison of text with inter-line and intra-line change highlights. The table can be generated in either full or contextual difference mode.
The following methods are provided for HTML generation:
See tools/scripts/diff.py for an example usage of this class.
There are no implemented interfaces.
There are no attributes in this class.
make_file(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
Returns HTML file of side by side comparison with change highlights
Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file column header string todesc -- "to" file column header string context -- set to True for contextual differences (defaults to False which shows full differences). numlines -- number of context lines. When context is set True, controls number of lines displayed before and after the change. When context is False, controls the number of lines to place the "next" link anchors before the next change (so click of "next" link jumps to just before the change).
make_table(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
Returns HTML table of side by side comparison with change highlights
Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file column header string todesc -- "to" file column header string context -- set to True for contextual differences (defaults to False which shows full differences). numlines -- number of context lines. When context is set True, controls number of lines displayed before and after the change. When context is False, controls the number of lines to place the "next" link anchors before the next change (so click of "next" link jumps to just before the change).
There are no known subclasses.