def _alldiffchunks(a, b, alines, blines): """like mdiff.allblocks, but only care about differences""" blocks = mdiff.allblocks(a, b, lines1=alines, lines2=blines) for chunk, btype in blocks: if btype != "!": continue yield chunk
def setUp(self): self.blocks = list(mdiff.allblocks(text1, text2)) assert self.blocks == [ ([0, 3, 0, 2], "!"), ((3, 7, 2, 6), "="), ([7, 12, 6, 12], "!"), ((12, 12, 12, 12), "="), ], self.blocks
def _diffblocks(self, a, b): return mdiff.allblocks(a, b, self.opts.diffopts)