9
print "gendiff tree .suffix"
19
for root, _, files in os.walk(tree):
21
fromfile = os.path.join(root, name)
22
tofile = os.path.join(root, os.path.splitext(name)[0])
23
if os.path.splitext(name)[-1] == suffix and os.path.exists(tofile):
24
fromdate = time.ctime(os.stat(fromfile).st_mtime)
25
todate = time.ctime(os.stat(tofile).st_mtime)
26
fromlines = open(fromfile, 'U').readlines()
27
tolines = open(tofile, 'U').readlines()
28
sys.stdout.writelines(difflib.unified_diff(
29
fromlines, tolines, fromfile, tofile, fromdate, todate))
33
if __name__ == '__main__':
37
# Local Variables: ***