File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import division
2
2
3
- import contextlib
4
3
import itertools
5
- import logging
6
4
import sys
7
- import time
8
5
from signal import SIGINT , default_int_handler , signal
9
6
10
7
from pip ._vendor import six
17
14
from pip ._internal .utils .typing import MYPY_CHECK_RUNNING
18
15
19
16
if MYPY_CHECK_RUNNING :
20
- from typing import Any , Iterator , IO
17
+ from typing import Any
21
18
22
19
try :
23
20
from pip ._vendor import colorama
26
23
except Exception :
27
24
colorama = None
28
25
26
+
29
27
def _select_progress_class (preferred , fallback ):
30
28
encoding = getattr (preferred .file , "encoding" , None )
31
29
Original file line number Diff line number Diff line change 16
16
17
17
logger = logging .getLogger (__name__ )
18
18
19
+
19
20
class SpinnerInterface (object ):
20
21
def spin (self ):
21
22
# type: () -> None
@@ -104,6 +105,7 @@ def finish(self, final_status):
104
105
self ._update ("finished with status '%s'" % (final_status ,))
105
106
self ._finished = True
106
107
108
+
107
109
class RateLimiter (object ):
108
110
def __init__ (self , min_update_interval_seconds ):
109
111
# type: (float) -> None
@@ -120,6 +122,7 @@ def reset(self):
120
122
# type: () -> None
121
123
self ._last_update = time .time ()
122
124
125
+
123
126
@contextlib .contextmanager
124
127
def open_spinner (message ):
125
128
# type: (str) -> Iterator[SpinnerInterface]
@@ -144,6 +147,7 @@ def open_spinner(message):
144
147
else :
145
148
spinner .finish ("done" )
146
149
150
+
147
151
@contextlib .contextmanager
148
152
def hidden_cursor (file ):
149
153
# type: (IO) -> Iterator[None]
@@ -162,4 +166,3 @@ def hidden_cursor(file):
162
166
yield
163
167
finally :
164
168
file .write (SHOW_CURSOR )
165
-
You can’t perform that action at this time.
0 commit comments