'Parameters
total : int or None
If an int, the number of increments in the process being
tracked and a `ProgressBar` is displayed.  If `None`, a
`Spinner` is displayed.
msg : str
The message to display above the `ProgressBar` or
alongside the `Spinner`.
color : str, optional
The color of ``msg``, if any.  Must be an ANSI terminal
color name.  Must be one of: black, red, green, brown,
blue, magenta, cyan, lightgrey, default, darkgrey,
lightred, lightgreen, yellow, lightblue, lightmagenta,
lightcyan, white.
file : writable file-like object, optional
The file to write the to.  Defaults to `sys.stdout`.  If
``file`` is not a tty (as determined by calling its `isatty`
member, if any), only ``msg`` will be displayed: the
`ProgressBar` or `Spinner` will be silent.'

def __init__(self, total, msg, color=u'default', file=None):

    if (file is None):
        file = _get_stdout()
    if ((total is None) or (not isatty(file))):
        self._is_spinner = True
        self._obj = Spinner(msg, color=color, file=file)
    else:
        self._is_spinner = False
        color_print(msg, color, file=file)
        self._obj = ProgressBar(total, file=file)
