OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
pip
/
_internal
/
models
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/16/2024 09:01:52 PM
rwxr-xr-x
📄
__init__.py
63 bytes
11/13/2023 09:31:06 PM
rw-r--r--
📁
__pycache__
-
02/16/2024 09:01:52 PM
rwxr-xr-x
📄
candidate.py
1.17 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
direct_url.py
6.74 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
format_control.py
2.76 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
index.py
1.13 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
installation_report.py
2.56 KB
03/16/2023 12:55:40 PM
rw-r--r--
📄
link.py
7.29 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
scheme.py
778 bytes
11/13/2023 09:31:06 PM
rw-r--r--
📄
search_scope.py
4.64 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
selection_prefs.py
2 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
target_python.py
3.94 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
wheel.py
2.71 KB
11/13/2023 09:31:06 PM
rw-r--r--
Editing: format_control.py
Close
from pip._vendor.packaging.utils import canonicalize_name from pip._internal.exceptions import CommandError from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional, Set, FrozenSet class FormatControl(object): """Helper for managing formats from which a package can be installed. """ __slots__ = ["no_binary", "only_binary"] def __init__(self, no_binary=None, only_binary=None): # type: (Optional[Set[str]], Optional[Set[str]]) -> None if no_binary is None: no_binary = set() if only_binary is None: only_binary = set() self.no_binary = no_binary self.only_binary = only_binary def __eq__(self, other): # type: (object) -> bool if not isinstance(other, self.__class__): return NotImplemented if self.__slots__ != other.__slots__: return False return all( getattr(self, k) == getattr(other, k) for k in self.__slots__ ) def __ne__(self, other): # type: (object) -> bool return not self.__eq__(other) def __repr__(self): # type: () -> str return "{}({}, {})".format( self.__class__.__name__, self.no_binary, self.only_binary ) @staticmethod def handle_mutual_excludes(value, target, other): # type: (str, Set[str], Set[str]) -> None if value.startswith('-'): raise CommandError( "--no-binary / --only-binary option requires 1 argument." ) new = value.split(',') while ':all:' in new: other.clear() target.clear() target.add(':all:') del new[:new.index(':all:') + 1] # Without a none, we want to discard everything as :all: covers it if ':none:' not in new: return for name in new: if name == ':none:': target.clear() continue name = canonicalize_name(name) other.discard(name) target.add(name) def get_allowed_formats(self, canonical_name): # type: (str) -> FrozenSet[str] result = {"binary", "source"} if canonical_name in self.only_binary: result.discard('source') elif canonical_name in self.no_binary: result.discard('binary') elif ':all:' in self.only_binary: result.discard('source') elif ':all:' in self.no_binary: result.discard('binary') return frozenset(result) def disallow_binaries(self): # type: () -> None self.handle_mutual_excludes( ':all:', self.no_binary, self.only_binary, )