MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _collect_lines

Method _collect_lines

tools/python-3.11.9-amd64/Lib/difflib.py:1838–1857  ·  view source on GitHub ↗

Collects mdiff output into separate lists Before storing the mdiff from/to data into a list, it is converted into a single line of text with HTML markup.

(self,diffs)

Source from the content-addressed store, hash-verified

1836 yield fromdata,todata,flag
1837
1838 def _collect_lines(self,diffs):
1839 """Collects mdiff output into separate lists
1840
1841 Before storing the mdiff from/to data into a list, it is converted
1842 into a single line of text with HTML markup.
1843 """
1844
1845 fromlist,tolist,flaglist = [],[],[]
1846 # pull from/to data and flags from mdiff style iterator
1847 for fromdata,todata,flag in diffs:
1848 try:
1849 # store HTML markup of the lines into the lists
1850 fromlist.append(self._format_line(0,flag,*fromdata))
1851 tolist.append(self._format_line(1,flag,*todata))
1852 except TypeError:
1853 # exceptions occur for lines where context separators go
1854 fromlist.append(None)
1855 tolist.append(None)
1856 flaglist.append(flag)
1857 return fromlist,tolist,flaglist
1858
1859 def _format_line(self,side,flag,linenum,text):
1860 """Returns HTML markup of "from" / "to" text lines

Callers 1

make_tableMethod · 0.95

Calls 2

_format_lineMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected