REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.05 KB
Close
//opt/hc_python/lib64/python3.12/site-packages/virtualenv/run/plugin/base.py
Text
Base64
from __future__ import annotations import sys from collections import OrderedDict from importlib.metadata import entry_points importlib_metadata_version = () class PluginLoader: _OPTIONS = None _ENTRY_POINTS = None @classmethod def entry_points_for(cls, key): if sys.version_info >= (3, 10) or importlib_metadata_version >= (3, 6): return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(group=key)) return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {})) @staticmethod def entry_points(): if PluginLoader._ENTRY_POINTS is None: PluginLoader._ENTRY_POINTS = entry_points() return PluginLoader._ENTRY_POINTS class ComponentBuilder(PluginLoader): def __init__(self, interpreter, parser, name, possible) -> None: self.interpreter = interpreter self.name = name self._impl_class = None self.possible = possible self.parser = parser.add_argument_group(title=name) self.add_selector_arg_parse(name, list(self.possible)) @classmethod def options(cls, key): if cls._OPTIONS is None: cls._OPTIONS = cls.entry_points_for(key) return cls._OPTIONS def add_selector_arg_parse(self, name, choices): raise NotImplementedError def handle_selected_arg_parse(self, options): selected = getattr(options, self.name) if selected not in self.possible: msg = f"No implementation for {self.interpreter}" raise RuntimeError(msg) self._impl_class = self.possible[selected] self.populate_selected_argparse(selected, options.app_data) return selected def populate_selected_argparse(self, selected, app_data): self.parser.description = f"options for {self.name} {selected}" self._impl_class.add_parser_arguments(self.parser, self.interpreter, app_data) def create(self, options): return self._impl_class(options, self.interpreter) __all__ = [ "ComponentBuilder", "PluginLoader", ]
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
activators.py
2.18 KB
lrw-r--r--
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base.py
2.05 KB
lrw-r--r--
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
creators.py
3.54 KB
lrw-r--r--
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
discovery.py
1.15 KB
lrw-r--r--
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
seeders.py
1.03 KB
lrw-r--r--
2025-04-04 08:02:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2025-04-04 08:02:01
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).