✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

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

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

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/hc_python/lib/python3.12/site-packages/build//_ctx.py
from __future__ import annotations

import contextvars
import logging
import subprocess
import typing

from collections.abc import Mapping, Sequence
from functools import partial

from ._types import StrPath


class _Logger(typing.Protocol):  # pragma: no cover
    def __call__(self, message: str, *, origin: tuple[str, ...] | None = None) -> None: ...


_package_name = __spec__.parent
_default_logger = logging.getLogger(_package_name)


def _log_default(message: str, *, origin: tuple[str, ...] | None = None) -> None:
    if origin is None:
        _default_logger.log(logging.INFO, message, stacklevel=2)


LOGGER = contextvars.ContextVar('LOGGER', default=_log_default)
VERBOSITY = contextvars.ContextVar('VERBOSITY', default=0)


def log_subprocess_error(error: subprocess.CalledProcessError) -> None:
    log = LOGGER.get()

    log(subprocess.list2cmdline(error.cmd), origin=('subprocess', 'cmd'))

    for stream_name in ('stdout', 'stderr'):
        stream = getattr(error, stream_name)
        if stream:
            log(stream.decode() if isinstance(stream, bytes) else stream, origin=('subprocess', stream_name))


def run_subprocess(cmd: Sequence[StrPath], env: Mapping[str, str] | None = None) -> None:
    verbosity = VERBOSITY.get()

    if verbosity:
        import concurrent.futures

        log = LOGGER.get()

        def log_stream(stream_name: str, stream: typing.IO[str]) -> None:
            for line in stream:
                log(line, origin=('subprocess', stream_name))

        with (
            concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor,
            subprocess.Popen(cmd, encoding='utf-8', env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as process,
        ):
            log(subprocess.list2cmdline(cmd), origin=('subprocess', 'cmd'))

            # Logging in sub-thread to more-or-less ensure order of stdout and stderr whilst also
            # being able to distinguish between the two.
            concurrent.futures.wait(
                [executor.submit(partial(log_stream, n, getattr(process, n))) for n in ('stdout', 'stderr')]
            )

            code = process.wait()
            if code:  # pragma: no cover
                raise subprocess.CalledProcessError(code, process.args)

    else:
        try:
            subprocess.run(cmd, capture_output=True, check=True, env=env)
        except subprocess.CalledProcessError as error:
            log_subprocess_error(error)
            raise


if typing.TYPE_CHECKING:
    log: _Logger
    verbosity: bool

else:

    def __getattr__(name):
        if name == 'log':
            return LOGGER.get()
        elif name == 'verbosity':
            return VERBOSITY.get()
        raise AttributeError(name)  # pragma: no cover


__all__ = [
    'LOGGER',
    'VERBOSITY',
    'log',
    'log_subprocess_error',
    'run_subprocess',
    'verbosity',
]


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 5.00 AM
root / root
0755
__pycache__
--
3 Dec 2025 6.01 AM
root / root
0755
_compat
--
3 Dec 2025 6.01 AM
root / root
0755
__init__.py
0.817 KB
3 Dec 2025 6.01 AM
root / root
0644
__main__.py
15.148 KB
3 Dec 2025 6.01 AM
root / root
0644
_builder.py
13.153 KB
3 Dec 2025 6.01 AM
root / root
0644
_ctx.py
2.817 KB
3 Dec 2025 6.01 AM
root / root
0644
_exceptions.py
1.587 KB
3 Dec 2025 6.01 AM
root / root
0644
_types.py
0.54 KB
3 Dec 2025 6.01 AM
root / root
0644
_util.py
2.271 KB
3 Dec 2025 6.01 AM
root / root
0644
env.py
13.907 KB
3 Dec 2025 6.01 AM
root / root
0644
py.typed
0 KB
3 Dec 2025 6.01 AM
root / root
0644
util.py
1.797 KB
3 Dec 2025 6.01 AM
root / root
0644

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