pgtools/pgdiff.py
changeset 6 4ab077c93b2d
parent 0 eaae9539e910
--- a/pgtools/pgdiff.py	Wed Jul 20 10:54:07 2011 +0200
+++ b/pgtools/pgdiff.py	Wed Aug 10 18:34:54 2011 +0200
@@ -29,18 +29,18 @@
 
 
 class DiffBase:
+    COLORS = {
+        '+' : BOLD | GREEN,
+        '-' : BOLD | RED,
+        '*' : BOLD | YELLOW}
+    
     def __init__(self):
         self.changes = None
 
     def format(self):
         out = ['  ' * self.level]
 
-        if self.change == '+':
-            out.append(highlight(1, BOLD | GREEN))
-        elif self.change == '-':
-            out.append(highlight(1, BOLD | RED))
-        else:
-            out.append(highlight(1, BOLD | YELLOW))
+        out.append(highlight(1, self.COLORS[self.change]))
         out.append(self.change)
         
         out += [' ', self.type, ' ', self.name, highlight(0)]