[Python-checkins] r66935 - in doctools/trunk/sphinx: __init__.py quickstart.py

georg.brandl python-checkins at python.org
Thu Oct 16 23:18:25 CEST 2008


Author: georg.brandl
Date: Thu Oct 16 23:18:24 2008
New Revision: 66935

Log:
Remove the win32 check, should be covered by color_terminal.
Add color_terminal check to quickstart.


Modified:
   doctools/trunk/sphinx/__init__.py
   doctools/trunk/sphinx/quickstart.py

Modified: doctools/trunk/sphinx/__init__.py
==============================================================================
--- doctools/trunk/sphinx/__init__.py	(original)
+++ doctools/trunk/sphinx/__init__.py	Thu Oct 16 23:18:24 2008
@@ -54,7 +54,7 @@
     from sphinx.application import Sphinx, SphinxError
     from docutils.utils import SystemMessage
 
-    if not sys.stdout.isatty() or sys.platform == 'win32' or not color_terminal():
+    if not sys.stdout.isatty() or not color_terminal():
         # Windows' poor cmd box doesn't understand ANSI sequences
         nocolor()
 

Modified: doctools/trunk/sphinx/quickstart.py
==============================================================================
--- doctools/trunk/sphinx/quickstart.py	(original)
+++ doctools/trunk/sphinx/quickstart.py	Thu Oct 16 23:18:24 2008
@@ -15,7 +15,7 @@
 TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
 
 from sphinx.util import make_filename
-from sphinx.util.console import purple, bold, red, turquoise, nocolor
+from sphinx.util.console import purple, bold, red, turquoise, nocolor, color_terminal
 from sphinx.util.texescape import tex_escape_map
 
 
@@ -380,7 +380,7 @@
 def inner_main(args):
     d = {}
 
-    if os.name == 'nt' or not sys.stdout.isatty():
+    if not sys.stdout.isatty() or not color_terminal():
         nocolor()
 
     print bold('Welcome to the Sphinx quickstart utility.')


More information about the Python-checkins mailing list