Mercurial > diff-colorize
comparison diff-colorize.py @ 3:10948e4fd070
Move the color constants above the format strings, since the color constants are more editable.
| author | Peter Hosey |
|---|---|
| date | Sun, 10 Aug 2008 23:29:49 -0700 |
| parents | 9eda9139d627 |
| children | b8b2d1931a9e |
comparison
equal
deleted
inserted
replaced
| 2:9eda9139d627 | 3:10948e4fd070 |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | |
| 3 INDEX_COLOR = 32 | |
| 4 REMOVED_COLOR = 203 | |
| 5 ADDED_COLOR = 2 | |
| 6 HUNK_START_COLOR = 32 | |
| 2 | 7 |
| 3 RESET_FORMAT = '\033[0m' | 8 RESET_FORMAT = '\033[0m' |
| 4 COLOR_FORMAT = '\033[38;5;%um' | 9 COLOR_FORMAT = '\033[38;5;%um' |
| 5 BEGIN_REVERSE_FORMAT = '\033[7m' | 10 BEGIN_REVERSE_FORMAT = '\033[7m' |
| 6 END_REVERSE_FORMAT = '\033[27m' | 11 END_REVERSE_FORMAT = '\033[27m' |
| 7 | |
| 8 INDEX_COLOR = 32 | |
| 9 REMOVED_COLOR = 203 | |
| 10 ADDED_COLOR = 2 | |
| 11 HUNK_START_COLOR = 32 | |
| 12 | 12 |
| 13 class OrderedDict(dict): | 13 class OrderedDict(dict): |
| 14 def __init__(self, input=None): | 14 def __init__(self, input=None): |
| 15 if input is None: | 15 if input is None: |
| 16 self.keys = [] | 16 self.keys = [] |
