diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2012-02-09 14:04:17 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2012-02-09 14:04:17 +0000 |
commit | 4d73f8586100da4bbf5dcfad94828ae0b227ec05 (patch) | |
tree | 75f9b1d7d4cbc9d60e0537689110edb0f0afcd77 /scripts/highlight.py | |
parent | fcab8cb3072724eca6ab8618ec16704451891f69 (diff) |
Fix highlight.py on Windows.
Diffstat (limited to 'scripts/highlight.py')
-rw-r--r-- | scripts/highlight.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/highlight.py b/scripts/highlight.py index 986bd1de..db6a37f9 100644 --- a/scripts/highlight.py +++ b/scripts/highlight.py @@ -158,12 +158,12 @@ class WindowsConsoleHighlighter(PlainHighlighter): import ctypes self._handle = ctypes.windll.kernel32.GetStdHandle(nStdHandle) else: - self._handle = INVALID_HANDLE_VALUE + self._handle = self.INVALID_HANDLE_VALUE self._attribute = self.white def _setAttribute(self, attr): - if self._handle != INVALID_HANDLE_VALUE: + if self._handle != self.INVALID_HANDLE_VALUE: import ctypes ctypes.windll.kernel32.SetConsoleTextAttribute(self._handle, attr) self._attribute = attr @@ -172,11 +172,11 @@ class WindowsConsoleHighlighter(PlainHighlighter): self._setAttribute(self._normal) def color(self, color): - intensity = self._attribute & FOREGROUND_INTENSITY + intensity = self._attribute & self.FOREGROUND_INTENSITY self._setAttribute(color | intensity) def bold(self): - self._setAttribute(self._attribute | FOREGROUND_INTENSITY) + self._setAttribute(self._attribute | self.FOREGROUND_INTENSITY) def italic(self): pass |