pgtoolkit/pgdiff.py
changeset 64 687e18e5ca93
parent 63 8c7f0a51ba50
child 83 515fadd3d286
--- a/pgtoolkit/pgdiff.py	Thu Jan 31 13:24:57 2013 +0100
+++ b/pgtoolkit/pgdiff.py	Thu Jan 31 13:41:48 2013 +0100
@@ -26,7 +26,6 @@
 
 
 from pgtoolkit.highlight import *
-from pgtoolkit.colordiff import colordiff
 
 import re
 import difflib
@@ -158,10 +157,9 @@
                     for line in difflib.unified_diff(a, b, lineterm=''):
                         if line[:3] in ('---', '+++'):
                             continue
-                        lines.append(line + '\n')
-                    diff = ''.join(lines)
-                    diff = colordiff(diff)
-                    res.append(diff)
+                        color = {' ': WHITE, '-': YELLOW, '+': GREEN, '@': WHITE|BOLD}[line[0]]
+                        lines.append(highlight(1, color) + line + highlight(0) + '\n')
+                    res.append(''.join(lines))
                 else:
                     res.append('Source differs.')
             else: