156 if self.show_body_diff: |
155 if self.show_body_diff: |
157 lines = ['Source differs:\n'] |
156 lines = ['Source differs:\n'] |
158 for line in difflib.unified_diff(a, b, lineterm=''): |
157 for line in difflib.unified_diff(a, b, lineterm=''): |
159 if line[:3] in ('---', '+++'): |
158 if line[:3] in ('---', '+++'): |
160 continue |
159 continue |
161 lines.append(line + '\n') |
160 color = {' ': WHITE, '-': YELLOW, '+': GREEN, '@': WHITE|BOLD}[line[0]] |
162 diff = ''.join(lines) |
161 lines.append(highlight(1, color) + line + highlight(0) + '\n') |
163 diff = colordiff(diff) |
162 res.append(''.join(lines)) |
164 res.append(diff) |
|
165 else: |
163 else: |
166 res.append('Source differs.') |
164 res.append('Source differs.') |
167 else: |
165 else: |
168 res.append(''.join(['Changed ', type, ' from ', |
166 res.append(''.join(['Changed ', type, ' from ', |
169 highlight(1,15), a, highlight(0), ' to ', |
167 highlight(1,15), a, highlight(0), ' to ', |