✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.51
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/cloudlinux/venv/lib/python3.11/site-packages/prospector//finder.py
from pathlib import Path
from typing import Callable, Iterable, Iterator, List

from prospector.exceptions import PermissionMissing
from prospector.pathutils import is_python_module, is_python_package, is_virtualenv

_SKIP_DIRECTORIES = (".git", ".tox", ".mypy_cache", ".pytest_cache", ".venv", "__pycache__", "node_modules")


class FileFinder:
    """
    This class is responsible for taking a combination of command-line arguments
    and configuration loaded from a profile to discover all files and modules which
    should be inspected.

    Individual tools can be told to ignore certain files, so the job of this class
    is basically to know which files to pass to which tools to be inspected.
    """

    def __init__(self, *provided_paths: Path, exclusion_filters: Iterable[Callable] = None):
        """
        :param provided_paths:
            A list of Path objects to search for files and modules - can be either directories or files
        :param exclusion_filters:
            An optional list of filters. All paths will be checked against this list - if any return True,
            the path is excluded.
        """
        self._provided_files = []
        self._provided_dirs = []
        self._exclusion_filters = [
            # we always want to ignore some things
            lambda _path: _path.is_dir() and _path.name in _SKIP_DIRECTORIES,
            is_virtualenv,
        ] + list(exclusion_filters or [])

        for path in provided_paths:
            if not path.exists():
                raise FileNotFoundError(path)
            # ensure all paths from now one are absolute paths; they can be converted
            # to relative paths for output purposes later
            path = path.absolute()
            if path.is_file():
                self._provided_files.append(path)
            if path.is_dir():
                self._provided_dirs.append(path)

    def make_syspath(self) -> List[Path]:
        paths = set()
        for path in self._provided_dirs:
            paths.add(path)
        for module in self.python_modules:
            paths.add(module.parent)
        return sorted(paths)

    def is_excluded(self, path: Path) -> bool:
        return any(filt(path) for filt in self._exclusion_filters)

    def _filter(self, paths: Iterable[Path]) -> List[Path]:
        return [path for path in paths if not self.is_excluded(path)]

    def _walk(self, directory: Path) -> Iterator[Path]:
        if not self.is_excluded(directory):
            yield directory

        for path in directory.iterdir():
            if self.is_excluded(path):
                continue
            if path.is_dir():
                yield from self._walk(path)
            else:
                yield path

    @property
    def files(self) -> List[Path]:
        """
        List every individual file found from the given configuration.

        This method is useful for tools which require an explicit list of files to check.
        """
        files = set()
        for path in self._provided_files:
            files.add(path)

        for directory in self.directories:
            for path in self._walk(directory):
                if path.is_file():
                    files.add(path)

        return self._filter(files)

    @property
    def python_packages(self) -> List[Path]:
        """
        Lists every directory found in the given configuration which is a python module (that is,
        contains an `__init__.py` file).

        This method is useful for passing to tools which will do their own discovery of python files.
        """
        return self._filter(d for d in self.directories if is_python_package(d))

    @property
    def python_modules(self) -> List[Path]:
        """
        Lists every directory found in the given configuration which is a python module (that is,
        contains an `__init__.py` file).

        This method is useful for passing to tools which will do their own discovery of python files.
        """
        return self._filter(f for f in self.files if is_python_module(f))

    @property
    def directories(self) -> List[Path]:
        """
        Lists every directory found from the given configuration, regardless of its contents.

        This method is useful for passing to tools which will do their own discovery of python files.
        """
        dirs = set()
        for directory in self._provided_dirs:
            dirs.add(directory)
            try:
                for obj in self._walk(directory):
                    if obj.is_dir():
                        dirs.add(obj)
            except PermissionError as err:
                raise PermissionMissing(obj) from err

        return self._filter(dirs)


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
8 Jul 2026 7.02 AM
root / root
0755
__pycache__
--
11 Feb 2026 8.04 AM
root / root
0755
config
--
11 Feb 2026 8.04 AM
root / root
0755
formatters
--
11 Feb 2026 8.04 AM
root / root
0755
profiles
--
11 Feb 2026 8.04 AM
root / root
0755
tools
--
11 Feb 2026 8.04 AM
root / root
0755
__init__.py
0 KB
20 Jan 2026 1.01 PM
root / root
0644
__main__.py
0.069 KB
20 Jan 2026 1.01 PM
root / root
0644
autodetect.py
2.886 KB
20 Jan 2026 1.01 PM
root / root
0644
blender.py
4.34 KB
20 Jan 2026 1.01 PM
root / root
0644
blender_combinations.yaml
6.397 KB
20 Jan 2026 1.01 PM
root / root
0644
compat.py
0.352 KB
20 Jan 2026 1.01 PM
root / root
0644
encoding.py
1.506 KB
20 Jan 2026 1.01 PM
root / root
0644
exceptions.py
1.261 KB
20 Jan 2026 1.01 PM
root / root
0644
finder.py
4.612 KB
20 Jan 2026 1.01 PM
root / root
0644
message.py
2.668 KB
20 Jan 2026 1.01 PM
root / root
0644
pathutils.py
1.275 KB
20 Jan 2026 1.01 PM
root / root
0644
postfilter.py
2.183 KB
20 Jan 2026 1.01 PM
root / root
0644
run.py
7.912 KB
20 Jan 2026 1.01 PM
root / root
0644
suppression.py
4.362 KB
20 Jan 2026 1.01 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF