$ sudo apt-get install kamaki
-Install ansicolors and/or progress (Optional but recommended)
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-.. code-block:: console
-
- $ sudo apt-get install python-ansicolors
- $ sudo apt-get install python-progress
-
.. _installing-from-source-ref:
Installing from source (git repos.)
$ cd kamaki
$ ./setup build install
-Install progress and/or ansicolors (optional)
-"""""""""""""""""""""""""""""""""""""""""""""
+Install ansicolors / progress
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Packages **ansicolors** and **progress** are not required for running kamaki, but
+they are recommended as a user experience improvement. In specific, ansicolors
+adds colors to kamaki responses and progress adds progressbars to the commands
+that can make use of it (*/store download*, */store upload*, */server wait* etc.)
-progress: command-line progress bars (in some commands)
+Debian and Ubuntu
+"""""""""""""""""
-ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`_)
+Follow the `Debian <#debian>`_ or `Ubuntu <#ubuntu>`_ installation procedure described earlier
+and then type:
.. code-block:: console
- $ pip install progress
+ #For ansicolors
+ $ sudo apt-get install python-ansicolors
+
+ # For progress
+ $ sudo apt-get install python-progress
+
+From source
+"""""""""""
+
+If setuptools is not installed, `install them <http://pypi.python.org/pypi/setuptools>`_ and then type:
+
+.. code-block:: console
+
+ #For ansicolors
$ pip install ansicolors
+ #For progress
+ $ pip install progress
+
Mac OS X
--------
from kamaki.cli.errors import raiseCLIError
+suggest = dict(
+ ansicolors=dict(
+ active=False,
+ url='#install-ansicolors-progress',
+ description='Add colors to console responses'),
+ progress=dict(
+ active=False,
+ url='#install-ansicolors-progress',
+ description='Add progress bars to some commands'))
+
try:
from colors import magenta, red, yellow, bold
except ImportError:
def dummy(val):
return val
red = yellow = magenta = bold = dummy
+ suggest['ansicolors']['active'] = True
+
+try:
+ from progress.bar import ShadyBar
+except ImportError:
+ suggest['progress']['active'] = True
+
+
+def suggest_missing(miss=None):
+ global suggest
+ kamaki_docs = 'http://www.synnefo.org/docs/kamaki/latest'
+ for k, v in (miss, suggest[miss]) if miss else suggest.items():
+ if v['active'] and stdout.isatty():
+ print('Suggestion: for better user experience install %s' % k)
+ print('\t%s' % v['description'])
+ print('\tIt is easy, here are the instructions:')
+ print('\t%s/installation.html%s' % (kamaki_docs, v['url']))
+ print('')
def remove_colors():