REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.55 KB
Close
//opt/cloudlinux/venv/lib/python3.11/site-packages/clselect/clselectnodejsuser/extensions.py
Text
Base64
# -*- coding: utf-8 -*- # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT from __future__ import print_function from __future__ import division from __future__ import absolute_import import glob import os from future.moves import configparser as ConfigParser from future.moves.configparser import SafeConfigParser class ExtensionInfo(object): doc_url = 'https://npmjs.org/package' def __init__(self, npm=None): if npm: self.npm = npm else: self.npm = sorted(glob.glob('/opt/alt/alt-nodejs*/root/usr/bin/npm'))[-1] def list_extensions(self): raise NotImplementedError("It's not used for nodejs selector") def list_extensions_cached(self): raise NotImplementedError("It's not used for nodejs selector") def write_cache(self): raise NotImplementedError("It's not used for nodejs selector") def list_extensions_version(self, extensions): raise NotImplementedError("It's not used for nodejs selector") @staticmethod def delete_cache(): raise NotImplementedError("It's not used for nodejs selector") @staticmethod def extension_doc(extension): return '/'.join([ExtensionInfo.doc_url, extension]) @staticmethod def extensions_docs(extensions): docs = [ExtensionInfo.extension_doc(ext) for ext in extensions] return dict((ext, {'doc': doc}) for ext, doc in zip(extensions, docs)) @staticmethod def get_locked_extensions(interpreter): alt_ver = interpreter.replace('.', '') file_path = os.path.join('/opt/alt', alt_ver, 'root', 'etc', 'locked_extensions.ini') if not os.path.exists(file_path): file_path = os.path.join(os.path.dirname(__file__), '..', 'locked_extensions.ini') parser = SafeConfigParser(interpolation=None, strict=False) parser.read(file_path) try: items = parser.items(interpreter) except ConfigParser.NoSectionError: items = () return dict((extension, [v.strip() for v in versions.split(',') if v]) for extension, versions in items) @staticmethod def is_extensions_locked(locked_extensions, extension, version): return (extension in locked_extensions and ( list(set([v.strip() for v in version.split(',') if len(version) > 0]) & set(locked_extensions.get(extension))) or len(locked_extensions.get(extension)) == 0 ))
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 5
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-03-25 07:03:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
environments.py
6.96 KB
lrw-r--r--
2026-02-26 15:36:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extensions.py
2.55 KB
lrw-r--r--
2026-02-26 15:36:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
interpreters.py
3.08 KB
lrw-r--r--
2026-02-26 15:36:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
nodevenv.py
2.67 KB
lrwxr-xr-x
2026-02-26 15:36:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2026-02-26 15:36:05
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).