=
=
=
=
=
= False
=
= 0
assert not
# Erase what we wrote before by backspacing to the beginning, writing
# spaces to overwrite the old text, and then backspacing again
= *
# Now we have a blank slate to add our status
=
return
return
return
= True
# Used for dumb terminals, non-interactive installs (no tty), etc.
# We still print updates occasionally (once every 60 seconds by default) to
# act as a keep-alive for systems like Travis-CI that take lack-of-output as
# an indication that a task has frozen.
=
= False
=
assert not
return
return
return
= True
=
: = 0
=
= -
return >=
=
# Interactive spinner goes directly to sys.stdout rather than being routed
# through the logging system, but it acts like it has level INFO,
# i.e. it's only displayed if we're at level INFO or better.
# Non-interactive spinner goes through the logging system, so it is always
# in sync with logging configuration.
: =
=
yield
=
=
# The Windows terminal does not support the hide/show cursor ANSI codes,
# even via colorama. So don't even try.
yield
# We don't want to clutter the output with control characters if we're
# writing to a file, or if the user is running with --quiet.
# See https://github.com/pypa/pip/issues/3418
not or > :
yield
yield