From 9520394149dc18bf83e3c11877d50f3b2cd27dff Mon Sep 17 00:00:00 2001 From: Erik Rose Date: Fri, 30 Aug 2013 16:29:51 -0400 Subject: Make does_styling attr public. Bump version to 1.6. This is more often what's intended when is_a_tty is examined. While a caller could keep track of what he's passed to the Terminal constructor, it is often more convenient to have the info available directly on the instance, which we're already passing around everywhere. --- README.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 0b2300b..8c7cd68 100644 --- a/README.rst +++ b/README.rst @@ -375,15 +375,15 @@ If you want to override this--like if you anticipate your program being piped through ``less -r``, which handles terminal escapes just fine--pass ``force_styling=True`` to the ``Terminal`` constructor. -In any case, there is an ``is_a_tty`` attribute on ``Terminal`` that lets you -see whether the attached stream seems to be a terminal. If it's false, you -might refrain from drawing progress bars and other frippery, since you're -apparently headed into a pipe:: +In any case, there is a ``does_styling`` attribute on ``Terminal`` that lets +you see whether your capabilities will return actual, working formatting codes. +If it's false, you should refrain from drawing progress bars and other frippery +and just stick to content, since you're apparently headed into a pipe:: from blessings import Terminal term = Terminal() - if term.is_a_tty: + if term.does_styling: with term.location(0, term.height - 1): print 'Progress: [=======> ]' print term.bold('Important stuff') @@ -433,6 +433,10 @@ Blessings is under the MIT License. See the LICENSE file. Version History =============== +1.6 + * Add ``does_styling`` attribute. This takes ``force_styling`` into account + and should replace most uses of ``is_a_tty``. + 1.5.1 * Clean up fabfile, removing the redundant ``test`` command. * Add Travis support. -- cgit v1.2.1