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
+1
View File
@@ -17,3 +17,4 @@ Patches and Suggestions
- Greg Haskins
- Miguel Araujo <maraujop>
- takluyver
- kracekumar
+9
View File
@@ -25,6 +25,15 @@ __all__ = (
)
COLORS = __all__[:-2]
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():