From c8e0a8759d8ea6584910cac0cddb30e04467e394 Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sat, 5 Jul 2014 01:39:13 +0900 Subject: [PATCH] Update documentation and `sphinx-build -N` option behavior for windows color console support. closes #1291. --- CHANGES | 2 +- doc/invocation.rst | 3 +-- sphinx/cmdline.py | 1 - sphinx/setup_command.py | 1 - sphinx/util/console.py | 2 ++ 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 4d9a68c03..a9641c966 100644 --- a/CHANGES +++ b/CHANGES @@ -39,7 +39,7 @@ New features submodule documentation. Thanks to Wes Turner and Luc Saffre. * #1434: Provide non-minified JS files for jquery.js and underscore.js to clarify the source of the minified files. -* PR#252: Windows color console support. Thanks to meu31. +* PR#252, #1291: Windows color console support. Thanks to meu31. Bugs fixed ---------- diff --git a/doc/invocation.rst b/doc/invocation.rst index 206fd200b..d347f5077 100644 --- a/doc/invocation.rst +++ b/doc/invocation.rst @@ -154,8 +154,7 @@ The :program:`sphinx-build` script has several options: .. option:: -N - Do not emit colored output. (On Windows, colored output is disabled in any - case.) + Do not emit colored output. .. option:: -v diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index 6e94ffbe2..6e7ab3267 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -82,7 +82,6 @@ Standard options def main(argv): if not color_terminal(): - # Windows' poor cmd box doesn't understand ANSI sequences nocolor() # parse options diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py index 8ed171136..0356073a6 100644 --- a/sphinx/setup_command.py +++ b/sphinx/setup_command.py @@ -138,7 +138,6 @@ class BuildDoc(Command): def run(self): if not color_terminal(): - # Windows' poor cmd box doesn't understand ANSI sequences nocolor() if not self.verbose: status_stream = StringIO() diff --git a/sphinx/util/console.py b/sphinx/util/console.py index 64eb4e478..2acc8eade 100644 --- a/sphinx/util/console.py +++ b/sphinx/util/console.py @@ -64,6 +64,8 @@ def color_terminal(): def nocolor(): + if sys.platform == 'win32' and colorama is not None: + colorama.deinit() codes.clear() def coloron():