summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Rose <erik@mozilla.com>2011-11-18 13:28:39 -0800
committerErik Rose <erik@mozilla.com>2011-11-18 13:28:39 -0800
commitfd2133a29c6fa34b1b3022dd17bf8ebcbd9de6c2 (patch)
treed5999923f4dce0657cfd460084155b6d8beb0065
parent163838a93f4a4fac40ab881b6691bb1cecb6e898 (diff)
downloadblessings-fd2133a29c6fa34b1b3022dd17bf8ebcbd9de6c2.tar.gz
Tweak readme and a comment.
-rw-r--r--README.rst8
-rw-r--r--blessings/__init__.py5
2 files changed, 9 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index beb3168..b71fdbb 100644
--- a/README.rst
+++ b/README.rst
@@ -177,9 +177,13 @@ everything back to normal afterward::
print term.bold_underline_green_on_yellow('Woo')
+This compound notation comes in handy if you want to allow users to customize
+the formatting of your app: just have them pass in a format specifier like
+"bold_green" on the command line, and do a quick ``getattr(term,
+that_option)('Your text')`` when you do your formatting.
+
I'd be remiss if I didn't credit couleur_, where I probably got the idea for
-all this mashing. It doesn't mix non-color styles in, but we started at the
-same place.
+all this mashing.
.. _couleur: http://pypi.python.org/pypi/couleur
diff --git a/blessings/__init__.py b/blessings/__init__.py
index 548d5b8..6b5c188 100644
--- a/blessings/__init__.py
+++ b/blessings/__init__.py
@@ -86,8 +86,9 @@ class Terminal(object):
# Sugary names for commonly-used capabilities, intended to help avoid trips
# to the terminfo man page and comments in your code:
_sugar = dict(
- # Don't use "on" as an underscore-separated chunk in any of these (e.g.
- # on_cology or rock_on) so we don't interfere with __getattr__.
+ # Don't use "on" or "bright" as an underscore-separated chunk in any of
+ # these (e.g. on_cology or rock_on) so we don't interfere with
+ # __getattr__.
save='sc',
restore='rc',