✘✘ 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.62
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

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

import argparse
import subprocess
from collections.abc import Sequence

from pre_commit.parse_shebang import normalize_cmd


def add_parsers(parser: argparse.ArgumentParser) -> None:
    subparsers = parser.add_subparsers(dest='tool')

    cd_parser = subparsers.add_parser(
        'cd', help='cd to a subdir and run the command',
    )
    cd_parser.add_argument('subdir')
    cd_parser.add_argument('cmd', nargs=argparse.REMAINDER)

    ignore_exit_code_parser = subparsers.add_parser(
        'ignore-exit-code', help='run the command but ignore the exit code',
    )
    ignore_exit_code_parser.add_argument('cmd', nargs=argparse.REMAINDER)

    n1_parser = subparsers.add_parser(
        'n1', help='run the command once per filename',
    )
    n1_parser.add_argument('cmd', nargs=argparse.REMAINDER)


def _cmd_filenames(cmd: tuple[str, ...]) -> tuple[
    tuple[str, ...],
    tuple[str, ...],
]:
    for idx, val in enumerate(reversed(cmd)):
        if val == '--':
            split = len(cmd) - idx
            break
    else:
        raise SystemExit('hazmat entry must end with `--`')

    return cmd[:split - 1], cmd[split:]


def cd(subdir: str, cmd: tuple[str, ...]) -> int:
    cmd, filenames = _cmd_filenames(cmd)

    prefix = f'{subdir}/'
    new_filenames = []
    for filename in filenames:
        if not filename.startswith(prefix):
            raise SystemExit(f'unexpected file without {prefix=}: {filename}')
        else:
            new_filenames.append(filename.removeprefix(prefix))

    cmd = normalize_cmd(cmd)
    return subprocess.call((*cmd, *new_filenames), cwd=subdir)


def ignore_exit_code(cmd: tuple[str, ...]) -> int:
    cmd = normalize_cmd(cmd)
    subprocess.call(cmd)
    return 0


def n1(cmd: tuple[str, ...]) -> int:
    cmd, filenames = _cmd_filenames(cmd)
    cmd = normalize_cmd(cmd)
    ret = 0
    for filename in filenames:
        ret |= subprocess.call((*cmd, filename))
    return ret


def impl(args: argparse.Namespace) -> int:
    args.cmd = tuple(args.cmd)
    if args.tool == 'cd':
        return cd(args.subdir, args.cmd)
    elif args.tool == 'ignore-exit-code':
        return ignore_exit_code(args.cmd)
    elif args.tool == 'n1':
        return n1(args.cmd)
    else:
        raise NotImplementedError(f'unexpected tool: {args.tool}')


def main(argv: Sequence[str] | None = None) -> int:
    parser = argparse.ArgumentParser()
    add_parsers(parser)
    args = parser.parse_args(argv)

    return impl(args)


if __name__ == '__main__':
    raise SystemExit(main())


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 5.00 AM
root / root
0755
__pycache__
--
11 Jun 2026 5.00 AM
root / root
0755
__init__.py
0 KB
11 Jun 2026 5.00 AM
root / root
0644
autoupdate.py
6.989 KB
11 Jun 2026 5.00 AM
root / root
0644
clean.py
0.419 KB
11 Jun 2026 5.00 AM
root / root
0644
gc.py
2.971 KB
11 Jun 2026 5.00 AM
root / root
0644
hazmat.py
2.513 KB
11 Jun 2026 5.00 AM
root / root
0644
hook_impl.py
9.285 KB
11 Jun 2026 5.00 AM
root / root
0644
init_templatedir.py
1.108 KB
11 Jun 2026 5.00 AM
root / root
0644
install_uninstall.py
5.216 KB
11 Jun 2026 5.00 AM
root / root
0644
migrate_config.py
4.065 KB
11 Jun 2026 5.00 AM
root / root
0644
run.py
13.831 KB
11 Jun 2026 5.00 AM
root / root
0644
sample_config.py
0.442 KB
11 Jun 2026 5.00 AM
root / root
0644
try_repo.py
2.518 KB
11 Jun 2026 5.00 AM
root / root
0644
validate_config.py
0.362 KB
11 Jun 2026 5.00 AM
root / root
0644
validate_manifest.py
0.368 KB
11 Jun 2026 5.00 AM
root / root
0644

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