KekLib.DiffUtils#

DiffUtils.py

Generating and applying diffs in python https://stackoverflow.com/questions/2307472/generating-and-applying-diffs-in-python

apply_patch(s, patch, revert=False)#

Apply unified diff patch to string s to recover newer string. If revert is True, treat s as the newer string, recover older string.

file2string(path)#
make_patch(a, b)#

Get unified string diff between two strings. Trims top two lines. Returns empty string if strings are identical.

string2file(text, path)#