GRAYBYTE WORDPRESS FILE MANAGER1132

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib/python3.8/site-packages/pip/_internal/models/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib/python3.8/site-packages/pip/_internal/models//format_control.py
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
# mypy: disallow-untyped-defs=False

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.
    """

    def __init__(self, no_binary=None, only_binary=None):
        # type: (Optional[Set], Optional[Set]) -> 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):
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self.__eq__(other)

    def __repr__(self):
        return "{}({}, {})".format(
            self.__class__.__name__,
            self.no_binary,
            self.only_binary
        )

    @staticmethod
    def handle_mutual_excludes(value, target, other):
        # type: (str, Optional[Set], Optional[Set]) -> 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
        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,
        )

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:45:22
root / root
0755
__pycache__
--
March 05 2024 23:45:22
root / root
0755
__init__.py
0.062 KB
October 17 2023 18:30:24
root / root
0644
candidate.py
1.247 KB
October 17 2023 18:30:24
root / root
0644
format_control.py
2.531 KB
October 17 2023 18:30:24
root / root
0644
index.py
1.035 KB
October 17 2023 18:30:24
root / root
0644
link.py
6.699 KB
October 17 2023 18:30:24
root / root
0644
search_scope.py
3.878 KB
October 17 2023 18:30:24
root / root
0644
selection_prefs.py
1.863 KB
October 17 2023 18:30:24
root / root
0644
target_python.py
3.73 KB
October 17 2023 18:30:24
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF