added a method to find current python interpreter is ipython, if so color shoudl be disabled

This commit is contained in:
kracekumar
2012-01-07 21:45:31 +05:30
parent 3709f090b4
commit 526cf84ebb
3 changed files with 13 additions and 3 deletions
+2 -1
View File
@@ -16,4 +16,5 @@ Patches and Suggestions
- Will Thames
- Greg Haskins
- Miguel Araujo <maraujop>
- takluyver
- takluyver
- kracekumar
+1 -1
View File
@@ -11,4 +11,4 @@ All functionality should be available in pure Python. Optional C (via Cython)
implementations may be written for performance reasons, but should never
replace the Python implementation.
Lastly, don't take yourself too seriously :)
Lastly, don't take yourself too seriously :)
+10 -1
View File
@@ -25,7 +25,16 @@ __all__ = (
)
COLORS = __all__[:-2]
DISABLE_COLOR = False
if 'get_ipython' in dir():
"""
when ipython is fired lot of variables like _oh, etc are used.
There are so many ways to find current python interpreter is ipython.
get_ipython is easiest is most appealing for readers to understand.
"""
DISABLE_COLOR = True
else:
DISABLE_COLOR = False
if not sys.stdout.isatty():
DISABLE_COLOR = True