REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.32 KB
Close
/opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/lint/caching.py
Text
Base64
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from __future__ import annotations import pickle import sys import warnings from pathlib import Path from pylint.constants import PYLINT_HOME from pylint.utils import LinterStats PYLINT_HOME_AS_PATH = Path(PYLINT_HOME) def _get_pdata_path( base_name: Path, recurs: int, pylint_home: Path = PYLINT_HOME_AS_PATH ) -> Path: # We strip all characters that can't be used in a filename. Also strip '/' and # '\\' because we want to create a single file, not sub-directories. underscored_name = "_".join( str(p.replace(":", "_").replace("/", "_").replace("\\", "_")) for p in base_name.parts ) return pylint_home / f"{underscored_name}_{recurs}.stats" def load_results( base: str | Path, pylint_home: str | Path = PYLINT_HOME ) -> LinterStats | None: base = Path(base) pylint_home = Path(pylint_home) data_file = _get_pdata_path(base, 1, pylint_home) if not data_file.exists(): return None try: with open(data_file, "rb") as stream: data = pickle.load(stream) if not isinstance(data, LinterStats): warnings.warn( "You're using an old pylint cache with invalid data following " f"an upgrade, please delete '{data_file}'.", UserWarning, ) raise TypeError return data except Exception: # pylint: disable=broad-except # There's an issue with the cache but we just continue as if it isn't there return None def save_results( results: LinterStats, base: str | Path, pylint_home: str | Path = PYLINT_HOME ) -> None: base = Path(base) pylint_home = Path(pylint_home) try: pylint_home.mkdir(parents=True, exist_ok=True) except OSError: # pragma: no cover print(f"Unable to create directory {pylint_home}", file=sys.stderr) data_file = _get_pdata_path(base, 1) try: with open(data_file, "wb") as stream: pickle.dump(results, stream) except OSError as ex: # pragma: no cover print(f"Unable to create file {data_file}: {ex}", file=sys.stderr)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 10
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-02-05 08:01:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base_options.py
20.95 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
caching.py
2.32 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
expand_modules.py
6.93 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
message_state_handler.py
17.07 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
parallel.py
6.40 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pylinter.py
52.36 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
report_functions.py
2.88 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
run.py
8.83 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.py
4.71 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
1.46 KB
lrw-r--r--
2026-01-20 13:01:48
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).