Method: difflib.HtmlDiff.make_file
Calls: 4, Exceptions: 0, Paths: 1Back
Path 1: 4 calls (1.0)
['', ' 1. Beautiful is beTTer than ugly.', ' 2. Explicit is better than implicit.', ' 3. Simple is better than complex.', ' 4. Complex is bett...
['', ' 1. Beautiful is better than ugly.', ' 3. Simple is better than complex.', ' 4. Complicated is better than complex.', ' 5. Flat is bet...
'' (3) 'from' (1)
'' (3) 'to' (1)
False (4)
5 (4)
'utf-8' (2) 'iso-8859-1' (1) 'us-ascii' (1)
'\n\n\n\n\n<...
1def make_file(self, fromlines, tolines, fromdesc='', todesc='',
2 context=False, numlines=5, *, charset='utf-8'):
3 """Returns HTML file of side by side comparison with change highlights
4
5 Arguments:
6 fromlines -- list of "from" lines
7 tolines -- list of "to" lines
8 fromdesc -- "from" file column header string
9 todesc -- "to" file column header string
10 context -- set to True for contextual differences (defaults to False
11 which shows full differences).
12 numlines -- number of context lines. When context is set True,
13 controls number of lines displayed before and after the change.
14 When context is False, controls the number of lines to place
15 the "next" link anchors before the next change (so click of
16 "next" link jumps to just before the change).
17 charset -- charset of the HTML document
18 """
19
20 return (self._file_template % dict(
21 styles=self._styles,
22 legend=self._legend,
23 table=self.make_table(fromlines, tolines, fromdesc, todesc,
24 context=context, numlines=numlines),
25 charset=charset
26 )).encode(charset, 'xmlcharrefreplace').decode(charset)