Commits

Andy Mikhailenko committed 66b920a

CLI: added support for the "blessings" library.

  • Participants
  • Parent commits 33fd4a2

Comments (0)

Files changed (4)

 # tests coverage, b) sphinx and setup.py properly import the version from a
 # single place so that I don't have to edit it always here and there.
 
-version = '0.7.1'
+version = '0.8.0'

File reqs/devel.txt

 unittest2
 coverage >= 3.3
 nose >= 0.11
+Sphinx >= 1.1
+Sphinx-PyPI-upload >= 0.2.1

File reqs/ext.txt

 wtforms >= 0.6
 colorama >= 0.1.18    # CLI colors
 SQLObject >= 0.16dev
-FormEncode-1.2.4      # for SQLObject
+FormEncode >= 1.2.4      # for SQLObject
 storm >= 0.18
 in turn a thin wrapper around `argparse` (bundled with Python 2.7+ and
 available as a separate package).
 
-The module also initializes colorama_ (for cross-platform terminal text output)
-and exports three of its objects: :class:`Fore`, :class:`Back` and
-:class:`Style`. If `colorama` is not available, dummy no-op objects are
-exported instead.
+The module also initializes these tools for advanced terminal text output:
+
+colorama_
+    Cross-platform. Exports three of its objects: :class:`Fore`, :class:`Back`
+    and :class:`Style`. If the module is not available, dummy no-op objects are
+    exported instead.
+blessings_
+    More powerful than `colorama` but doesn't provide native support for
+    Windows. Exports `term` object which is a :class:`blessings.Terminal`
+    instance. If the module is not available, `term` becomes ``None``.
 
 .. _Argh: http://pypi.python.org/pypi/argh
 .. _colorama: http://pypi.python.org/pypi/colorama
+.. _blessings: http://pypi.python.org/pypi/blessings
 
 Overview
 --------
             return ''
     Fore = Back = Style = Dummy()
     init = lambda x=None:None
+
+try:
+    from blessings import Terminal
+except ImportError:
+    term = None
+else:
+    term = Terminal()