#NEWLINE# def __init__( self , label = None , total = 0 , stream = sys . stderr , interactive = None , timer = None , hide_cursor = True ) : #NEWLINE# #INDENT# "\n        Initialize a spinner.\n\n        :param label: The label for the spinner (a string, defaults to ``None``).\n        :param total: The expected number of steps (an integer).\n        :param stream: The output stream to show the spinner on (defaults to\n                       :py:data:`sys.stderr`).\n        :param interactive: If this is ``False`` then the spinner doesn't write\n                            to the output stream at all. It defaults to the\n                            return value of ``stream.isatty()``.\n        :param timer: A :py:class:`Timer` object (optional). If this is given\n                      the spinner will show the elapsed time according to the\n                      timer.\n        :param hide_cursor: If ``True`` (the default) the text cursor is hidden\n                            as long as the spinner is active.\n        " #NEWLINE# self . label = label #NEWLINE# self . total = total #NEWLINE# self . stream = stream #NEWLINE# self . states = [ '-' , '\\' , '|' , '/' ] #NEWLINE# self . counter = 0 #NEWLINE# self . last_update = 0 #NEWLINE# if ( interactive is None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# interactive = stream . isatty ( ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# interactive = False #NEWLINE# #UNINDENT# #UNINDENT# self . interactive = interactive #NEWLINE# self . timer = timer #NEWLINE# self . hide_cursor = hide_cursor #NEWLINE# if ( self . interactive and self . hide_cursor ) : #NEWLINE# #INDENT# self . stream . write ( hide_cursor_code )