summaryrefslogtreecommitdiff
path: root/pylint/reporters
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-03-27 19:33:36 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-03-27 19:33:36 +0200
commit8828a5bb41eb9198a3d80983d655d445ac917b14 (patch)
tree128f3701aaa67cd0d938384198c7580758346828 /pylint/reporters
parent68db188835c4e89d1a92e9c7874f0e6b7bae9eb7 (diff)
downloadpylint-8828a5bb41eb9198a3d80983d655d445ac917b14.tar.gz
The colorized reporter now works on Windows. Closes issue #96.
Diffstat (limited to 'pylint/reporters')
-rw-r--r--pylint/reporters/text.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py
index 53c4a8d..7b76674 100644
--- a/pylint/reporters/text.py
+++ b/pylint/reporters/text.py
@@ -19,13 +19,15 @@
from __future__ import print_function
import warnings
+import sys
+import six
from logilab.common.ureports import TextWriter
from logilab.common.textutils import colorize_ansi
from pylint.interfaces import IReporter
from pylint.reporters import BaseReporter
-import six
+
TITLE_UNDERLINES = ['', '=', '-', '.']
@@ -106,6 +108,9 @@ class ColorizedTextReporter(TextReporter):
TextReporter.__init__(self, output)
self.color_mapping = color_mapping or \
dict(ColorizedTextReporter.COLOR_MAPPING)
+ if sys.platform == 'win32':
+ import colorama
+ self.out = colorama.AnsiToWin32(self.out)
def _get_decoration(self, msg_id):
"""Returns the tuple color, style associated with msg_id as defined