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)
| 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 |
no test coverage detected