Revision 0d735aaf

b/docs/installation.rst
65 65

  
66 66
        $ sudo apt-get install kamaki
67 67

  
68
Install ansicolors and/or progress (Optional but recommended)
69
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
70

  
71
.. code-block:: console
72

  
73
    $ sudo apt-get install python-ansicolors
74
    $ sudo apt-get install python-progress
75

  
76 68
.. _installing-from-source-ref:
77 69

  
78 70
Installing from source (git repos.)
......
136 128
    $ cd kamaki
137 129
    $ ./setup build install
138 130

  
139
Install progress and/or ansicolors (optional)
140
"""""""""""""""""""""""""""""""""""""""""""""
131
Install ansicolors / progress
132
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133

  
134
Packages **ansicolors** and **progress** are not required for running kamaki, but
135
they are recommended as a user experience improvement. In specific, ansicolors
136
adds colors to kamaki responses and progress adds progressbars to the commands
137
that can make use of it (*/store download*, */store upload*, */server wait* etc.)
141 138

  
142
progress: command-line progress bars (in some commands)
139
Debian and Ubuntu
140
"""""""""""""""""
143 141

  
144
ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`_)
142
Follow the `Debian <#debian>`_ or `Ubuntu <#ubuntu>`_ installation procedure described earlier
143
and then type:
145 144

  
146 145
.. code-block:: console
147 146

  
148
    $ pip install progress
147
    #For ansicolors
148
    $ sudo apt-get install python-ansicolors
149

  
150
    # For progress
151
    $ sudo apt-get install python-progress
152

  
153
From source
154
"""""""""""
155

  
156
If setuptools is not installed, `install them <http://pypi.python.org/pypi/setuptools>`_ and then type:
157

  
158
.. code-block:: console
159

  
160
    #For ansicolors
149 161
    $ pip install ansicolors
150 162

  
163
    #For progress
164
    $ pip install progress
165

  
151 166
Mac OS X
152 167
--------
153 168

  
b/kamaki/cli/__init__.py
390 390

  
391 391
        _init_session(parser.arguments)
392 392

  
393
        from kamaki.cli.utils import suggest_missing
394
        suggest_missing()
395

  
393 396
        if parser.unparsed:
394 397
            run_one_cmd(exe, parser)
395 398
        elif _help:
b/kamaki/cli/utils.py
37 37

  
38 38
from kamaki.cli.errors import raiseCLIError
39 39

  
40
suggest = dict(
41
    ansicolors=dict(
42
        active=False,
43
        url='#install-ansicolors-progress',
44
        description='Add colors to console responses'),
45
    progress=dict(
46
        active=False,
47
        url='#install-ansicolors-progress',
48
        description='Add progress bars to some commands'))
49

  
40 50
try:
41 51
    from colors import magenta, red, yellow, bold
42 52
except ImportError:
......
44 54
    def dummy(val):
45 55
        return val
46 56
    red = yellow = magenta = bold = dummy
57
    suggest['ansicolors']['active'] = True
58

  
59
try:
60
    from progress.bar import ShadyBar
61
except ImportError:
62
    suggest['progress']['active'] = True
63

  
64

  
65
def suggest_missing(miss=None):
66
    global suggest
67
    kamaki_docs = 'http://www.synnefo.org/docs/kamaki/latest'
68
    for k, v in (miss, suggest[miss]) if miss else suggest.items():
69
        if v['active'] and stdout.isatty():
70
            print('Suggestion: for better user experience install %s' % k)
71
            print('\t%s' % v['description'])
72
            print('\tIt is easy, here are the instructions:')
73
            print('\t%s/installation.html%s' % (kamaki_docs, v['url']))
74
            print('')
47 75

  
48 76

  
49 77
def remove_colors():

Also available in: Unified diff