7 def getdiff (old, new):
11 for l in difflib.unified_diff (a.read ().splitlines (), b.read ().splitlines ()):
15 def dc_getdiff (dc, old, new):
17 for f in dc.left_only:
18 diff.append ("Only in {}: {}".format (old, f))
19 for f in dc.right_only:
20 diff.append ("Only in {}: {}".format (new, f))
21 for f in dc.diff_files:
22 r = getdiff (os.path.join (old, f), os.path.join (new, f))
24 for dn, dc in dc.subdirs.items ():
25 r = dc_getdiff (dc, os.path.join (old, dn), os.path.join (new, dn))
29 def dcdiff (old, new):
30 dc = filecmp.dircmp (old, new)
31 diff = dc_getdiff (dc, old, new)
35 for l in dcdiff (sys.argv[1], sys.argv[2]):
38 if __name__ == '__main__':