Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.cli.spinners Namespace Reference

Data Structures

class  InteractiveSpinner
 
class  NonInteractiveSpinner
 
class  RateLimiter
 
class  SpinnerInterface
 

Functions

Generator[SpinnerInterface, None, Noneopen_spinner (str message)
 
Generator[None, None, Nonehidden_cursor (IO[str] file)
 

Variables

 logger = logging.getLogger(__name__)
 
str HIDE_CURSOR = "\x1b[?25l"
 
str SHOW_CURSOR = "\x1b[?25h"
 

Function Documentation

◆ hidden_cursor()

Generator[None, None, None] hidden_cursor ( IO[str]  file)

Definition at line 144 of file spinners.py.

144def hidden_cursor(file: IO[str]) -> Generator[None, None, None]:
145 # The Windows terminal does not support the hide/show cursor ANSI codes,
146 # even via colorama. So don't even try.
147 if WINDOWS:
148 yield
149 # We don't want to clutter the output with control characters if we're
150 # writing to a file, or if the user is running with --quiet.
151 # See https://github.com/pypa/pip/issues/3418
153 yield
154 else:
155 file.write(HIDE_CURSOR)
156 try:
157 yield
158 finally:
159 file.write(SHOW_CURSOR)
for i

References i.

Referenced by pip._internal.cli.spinners.open_spinner().

Here is the caller graph for this function:

◆ open_spinner()

Generator[SpinnerInterface, None, None] open_spinner ( str  message)

Definition at line 116 of file spinners.py.

116def open_spinner(message: str) -> Generator[SpinnerInterface, None, None]:
117 # Interactive spinner goes directly to sys.stdout rather than being routed
118 # through the logging system, but it acts like it has level INFO,
119 # i.e. it's only displayed if we're at level INFO or better.
120 # Non-interactive spinner goes through the logging system, so it is always
121 # in sync with logging configuration.
123 spinner: SpinnerInterface = InteractiveSpinner(message)
124 else:
125 spinner = NonInteractiveSpinner(message)
126 try:
127 with hidden_cursor(sys.stdout):
128 yield spinner
129 except KeyboardInterrupt:
130 spinner.finish("canceled")
131 raise
132 except Exception:
133 spinner.finish("error")
134 raise
135 else:
136 spinner.finish("done")
137
138

References pip._internal.cli.spinners.hidden_cursor(), and i.

Here is the call graph for this function:

Variable Documentation

◆ HIDE_CURSOR

str HIDE_CURSOR = "\x1b[?25l"

Definition at line 139 of file spinners.py.

◆ logger

logger = logging.getLogger(__name__)

Definition at line 11 of file spinners.py.

◆ SHOW_CURSOR

str SHOW_CURSOR = "\x1b[?25h"

Definition at line 140 of file spinners.py.