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:
@@ -16,4 +16,5 @@ Patches and Suggestions
|
|||||||
- Will Thames
|
- Will Thames
|
||||||
- Greg Haskins
|
- Greg Haskins
|
||||||
- Miguel Araujo <maraujop>
|
- Miguel Araujo <maraujop>
|
||||||
- takluyver
|
- takluyver
|
||||||
|
- kracekumar
|
||||||
|
|||||||
@@ -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
|
implementations may be written for performance reasons, but should never
|
||||||
replace the Python implementation.
|
replace the Python implementation.
|
||||||
|
|
||||||
Lastly, don't take yourself too seriously :)
|
Lastly, don't take yourself too seriously :)
|
||||||
|
|||||||
+10
-1
@@ -25,7 +25,16 @@ __all__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
COLORS = __all__[:-2]
|
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():
|
if not sys.stdout.isatty():
|
||||||
DISABLE_COLOR = True
|
DISABLE_COLOR = True
|
||||||
|
|||||||
Reference in New Issue
Block a user