REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.20 KB
Close
//opt/imunify360/venv/lib64/python3.11/site-packages/pip/_internal/req/pep723.py
Text
Base64
import re from typing import Any from pip._internal.utils.compat import tomllib REGEX = r"(?m)^# /// (?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$" class PEP723Exception(ValueError): """Raised to indicate a problem when parsing PEP 723 metadata from a script""" def __init__(self, msg: str) -> None: self.msg = msg def pep723_metadata(scriptfile: str) -> dict[str, Any]: with open(scriptfile) as f: script = f.read() name = "script" matches = list( filter(lambda m: m.group("type") == name, re.finditer(REGEX, script)) ) if len(matches) > 1: raise PEP723Exception(f"Multiple {name!r} blocks found in {scriptfile!r}") elif len(matches) == 1: content = "".join( line[2:] if line.startswith("# ") else line[1:] for line in matches[0].group("content").splitlines(keepends=True) ) try: metadata = tomllib.loads(content) except Exception as exc: raise PEP723Exception(f"Failed to parse TOML in {scriptfile!r}") from exc else: raise PEP723Exception( f"File does not contain {name!r} metadata: {scriptfile!r}" ) return metadata
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-05-27 11:04:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
constructors.py
18.25 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pep723.py
1.20 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
req_dependency_group.py
2.56 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
req_file.py
20.20 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
req_install.py
30.54 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
req_set.py
2.76 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
req_uninstall.py
23.53 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
2.97 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).