diff options
author | Shubham Saini <shubham6405@gmail.com> | 2019-08-05 08:32:33 +0000 |
---|---|---|
committer | Shubham Saini <shubham6405@gmail.com> | 2019-08-05 08:32:33 +0000 |
commit | 227b2d30a8675b44918f9d9ca89b24144a938215 (patch) | |
tree | 9f8e6a28724514b6fdf463a9ab2067a7ef309b72 /venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py | |
parent | 842a8cfbbbdb1f92889d892e4859dbd5d40c5be8 (diff) |
removing venv files
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py')
-rw-r--r-- | venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py deleted file mode 100644 index d44e6f1..0000000 --- a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/__init__.py +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | """ | ||
2 | Package containing all pip commands | ||
3 | """ | ||
4 | from __future__ import absolute_import | ||
5 | |||
6 | from pip._internal.commands.completion import CompletionCommand | ||
7 | from pip._internal.commands.configuration import ConfigurationCommand | ||
8 | from pip._internal.commands.download import DownloadCommand | ||
9 | from pip._internal.commands.freeze import FreezeCommand | ||
10 | from pip._internal.commands.hash import HashCommand | ||
11 | from pip._internal.commands.help import HelpCommand | ||
12 | from pip._internal.commands.list import ListCommand | ||
13 | from pip._internal.commands.check import CheckCommand | ||
14 | from pip._internal.commands.search import SearchCommand | ||
15 | from pip._internal.commands.show import ShowCommand | ||
16 | from pip._internal.commands.install import InstallCommand | ||
17 | from pip._internal.commands.uninstall import UninstallCommand | ||
18 | from pip._internal.commands.wheel import WheelCommand | ||
19 | |||
20 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING | ||
21 | |||
22 | if MYPY_CHECK_RUNNING: | ||
23 | from typing import List, Type | ||
24 | from pip._internal.basecommand import Command | ||
25 | |||
26 | commands_order = [ | ||
27 | InstallCommand, | ||
28 | DownloadCommand, | ||
29 | UninstallCommand, | ||
30 | FreezeCommand, | ||
31 | ListCommand, | ||
32 | ShowCommand, | ||
33 | CheckCommand, | ||
34 | ConfigurationCommand, | ||
35 | SearchCommand, | ||
36 | WheelCommand, | ||
37 | HashCommand, | ||
38 | CompletionCommand, | ||
39 | HelpCommand, | ||
40 | ] # type: List[Type[Command]] | ||
41 | |||
42 | commands_dict = {c.name: c for c in commands_order} | ||
43 | |||
44 | |||
45 | def get_summaries(ordered=True): | ||
46 | """Yields sorted (command name, command summary) tuples.""" | ||
47 | |||
48 | if ordered: | ||
49 | cmditems = _sort_commands(commands_dict, commands_order) | ||
50 | else: | ||
51 | cmditems = commands_dict.items() | ||
52 | |||
53 | for name, command_class in cmditems: | ||
54 | yield (name, command_class.summary) | ||
55 | |||
56 | |||
57 | def get_similar_commands(name): | ||
58 | """Command name auto-correct.""" | ||
59 | from difflib import get_close_matches | ||
60 | |||
61 | name = name.lower() | ||
62 | |||
63 | close_commands = get_close_matches(name, commands_dict.keys()) | ||
64 | |||
65 | if close_commands: | ||
66 | return close_commands[0] | ||
67 | else: | ||
68 | return False | ||
69 | |||
70 | |||
71 | def _sort_commands(cmddict, order): | ||
72 | def keyfn(key): | ||
73 | try: | ||
74 | return order.index(key[1]) | ||
75 | except ValueError: | ||
76 | # unordered items should come last | ||
77 | return 0xff | ||
78 | |||
79 | return sorted(cmddict.items(), key=keyfn) | ||