1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| def _report(ctx): # Print a report on the differences between a and b
# Output format is purposely lousy
#print('diff', ctx.left, ctx.right)
if ctx.left_only:
ctx.left_only.sort()
#print('Only in', ctx.left, ':', ctx.left_only)
_left.append(str(ctx.left) + "\\" + ctx.left_only[0])
#print(str(localDiff))
if ctx.right_only:
ctx.right_only.sort()
#print('Only in', ctx.right, ':', ctx.right_only)
_right.append(str(ctx.right) + "\\" + ctx.right_only[0])
#print(str(nasDiff))
if ctx.diff_files:
ctx.diff_files.sort()
#print('Differing files :', ctx.diff_files)
_left.append(ctx.diff_files[0])
def _report_full(ctx):
_report(ctx)
for sd in ctx.subdirs.values():
_report_full(sd)
def report_full(a, b):
global _left, _right
_left = []
_right = []
_report_full(filecmp.dircmp(a, b))
return _left, _right |
Partager