r""" Format "?" output and deal with tabs. Example: >>> d = Differ() >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n', ... ' ^ ^ ^ ', ' ^ ^ ^ ') >>> for line in results: print(repr(line)) ...
(self, aline, bline, atags, btags)
| 995 | yield from g |
| 996 | |
| 997 | def _qformat(self, aline, bline, atags, btags): |
| 998 | r""" |
| 999 | Format "?" output and deal with tabs. |
| 1000 | |
| 1001 | Example: |
| 1002 | |
| 1003 | >>> d = Differ() |
| 1004 | >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n', |
| 1005 | ... ' ^ ^ ^ ', ' ^ ^ ^ ') |
| 1006 | >>> for line in results: print(repr(line)) |
| 1007 | ... |
| 1008 | '- \tabcDefghiJkl\n' |
| 1009 | '? \t ^ ^ ^\n' |
| 1010 | '+ \tabcdefGhijkl\n' |
| 1011 | '? \t ^ ^ ^\n' |
| 1012 | """ |
| 1013 | atags = _keep_original_ws(aline, atags).rstrip() |
| 1014 | btags = _keep_original_ws(bline, btags).rstrip() |
| 1015 | |
| 1016 | yield "- " + aline |
| 1017 | if atags: |
| 1018 | yield f"? {atags}\n" |
| 1019 | |
| 1020 | yield "+ " + bline |
| 1021 | if btags: |
| 1022 | yield f"? {btags}\n" |
| 1023 | |
| 1024 | # With respect to junk, an earlier version of ndiff simply refused to |
| 1025 | # *start* a match with a junk element. The result was cases like this: |
no test coverage detected