Skip to content

Loading…

Develop - fixed issue 9 #24

Merged
merged 3 commits into from

2 participants

@kracekumar

Fixed this #9
This commit don't work b58f8dc
better way to check is to run dir() check for get_ipython .

Existing solution will fail .

In [4]: sys.stdout.isatty()
Out[4]: True

@kennethreitz

Thanks for the fix!

@kennethreitz kennethreitz merged commit 73a9cd8 into kennethreitz:develop
@kracekumar

Its my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 7, 2012
  1. @kracekumar
  2. @kracekumar

    fixed spaces

    kracekumar committed
  3. @kracekumar

    works perfectly fine with ipython, standard python interpreter and un…

    kracekumar committed
    …fortuantely clint colors wont work in dreampie :(
Showing with 11 additions and 5 deletions.
  1. +2 −1 AUTHORS
  2. +1 −1 HACKING
  3. +8 −3 clint/textui/colored.py
View
3 AUTHORS
@@ -16,4 +16,5 @@ Patches and Suggestions
- Will Thames
- Greg Haskins
- Miguel Araujo <maraujop>
-- takluyver
+- takluyver
+- kracekumar
View
2 HACKING
@@ -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 :)
View
11 clint/textui/colored.py
@@ -25,12 +25,17 @@
)
COLORS = __all__[:-2]
-DISABLE_COLOR = False
-if not sys.stdout.isatty():
+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:
- colorama.init(autoreset=True)
+ DISABLE_COLOR = False
+
class ColoredString(object):
Something went wrong with that request. Please try again.