mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 06:46:16 +00:00
added a method to find current python interpreter is ipython, if so color shoudl be disabled
This commit is contained in:
@@ -17,3 +17,4 @@ Patches and Suggestions
|
||||
- Greg Haskins
|
||||
- Miguel Araujo <maraujop>
|
||||
- takluyver
|
||||
- kracekumar
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user