Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sinscary authored and = committed Sep 27, 2019
1 parent 3e19757 commit 47b5738
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/pip/_internal/cli/progress_bars.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from __future__ import division

import contextlib
import itertools
import logging
import sys
import time
from signal import SIGINT, default_int_handler, signal

from pip._vendor import six
Expand All @@ -17,7 +14,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Any, Iterator, IO
from typing import Any

try:
from pip._vendor import colorama
Expand All @@ -26,6 +23,7 @@
except Exception:
colorama = None


def _select_progress_class(preferred, fallback):
encoding = getattr(preferred.file, "encoding", None)

Expand Down
5 changes: 4 additions & 1 deletion src/pip/_internal/cli/spinners.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

logger = logging.getLogger(__name__)


class SpinnerInterface(object):
def spin(self):
# type: () -> None
Expand Down Expand Up @@ -104,6 +105,7 @@ def finish(self, final_status):
self._update("finished with status '%s'" % (final_status,))
self._finished = True


class RateLimiter(object):
def __init__(self, min_update_interval_seconds):
# type: (float) -> None
Expand All @@ -120,6 +122,7 @@ def reset(self):
# type: () -> None
self._last_update = time.time()


@contextlib.contextmanager
def open_spinner(message):
# type: (str) -> Iterator[SpinnerInterface]
Expand All @@ -144,6 +147,7 @@ def open_spinner(message):
else:
spinner.finish("done")


@contextlib.contextmanager
def hidden_cursor(file):
# type: (IO) -> Iterator[None]
Expand All @@ -162,4 +166,3 @@ def hidden_cursor(file):
yield
finally:
file.write(SHOW_CURSOR)

0 comments on commit 47b5738

Please sign in to comment.