Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectpython/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectpython/__pycache__/pkgmanager.cpython-311.pyc

�

!�g(��z�ddlmZddlmZddlmZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
Gd�d	e��ZdS)
�)�print_function)�division)�absolute_importN)�BasePkgManager�)�scan_python_versions�is_major_version�
CONFIG_DIR�create_config_dirs�	ALT_NAMES�ALT_PYTHON_PREFIXc���eZdZdZd�ZeZdZeZ	dZ
d�ede	de
g��Zd�ede	de
g��Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zed���ZdS)�
PkgManagerz�
    Class responsible for all interactions with Yum, python version
    installation/removal and gathering info about already installed versions
    c�"�t��dS�N)r��selfs �Y/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectpython/pkgmanager.py�_create_config_dirszPkgManager._create_config_dirss��������z)LANG=C yum --disableplugin=fastestmirror z!&>/var/log/cl-python-last-yum.log�z-y install z{} z
-y remove c��t��Sr)rrs r�_scan_interpreter_versionsz%PkgManager._scan_interpreter_versions?s��#�%�%�%rc�d�td�|�dd����zS)Nz{}/.lock�.r)r
�format�replace�r�versions  r�_get_lock_file_pathzPkgManager._get_lock_file_pathBs2�� �:�#4�#4��O�O�C��$�$�$&�$&�&�	&rc��|���}|s|���dStjd|��}d�|D��}|S)a�
        Should return list of major versions available to install from
        currently enabled repos.
            Note, this can be an empty list if no NodeJS version has been
            released to repos yet or in case of network/repos/yum problem.
        OR
            None if our cache is updating right now because it was
            absent/outdated/corrupted/etc.
        :rtype: list | None
        Nzalt-python(\d+)c�X�g|]'}d�|d|dd�g����(S)rrrN)�join)�.0rs  r�
<listcomp>z1PkgManager.checkout_available.<locals>.<listcomp>Zs5��R�R�R�W�S�X�X�w�q�z�7�1�2�2�;�7�8�8�R�R�Rr)�_read_yum_cache�update_yum_cache�re�findall)r�data�	availables   r�checkout_availablezPkgManager.checkout_availableFs_���#�#�%�%���	��!�!�#�#�#��4��J�0�$�7�7�	�R�R�	�R�R�R�	��rc�~�t|��sd�|��S|���}|r|SdS)z5Do some common pre-installation/uninstallation checksz>Invalid version "{}". It should be two digits separeted by dotN)r	r�_check_yum_in_progress)rr�
working_errors   r�_verify_actionzPkgManager._verify_action]sR����(�(�	N�>�>D�f�W�o�o�
N��3�3�5�5�
��	!� � �	!�	!rc�^�|j�|�dd����S)z�
        Formatting cmd string for install package
        :return: formatted cmd string
        :param version: version of interpreter for installing
        :rtype: str
        rr)�_install_cmdrrrs  r� format_cmd_string_for_installingz+PkgManager.format_cmd_string_for_installingfs)��� �'�'�����R�(@�(@�A�A�Arc�^�|j�|�dd����S)z�
        Formatting cmd string for removing package
        :return: formatted cmd string
        :param version: version of interpreter for removing
        :rtype: str
        rr)�_remove_cmdrrrs  r�format_cmd_string_for_removingz)PkgManager.format_cmd_string_for_removingps)����&�&�w���s�B�'?�'?�@�@�@rc�L�ddlm}|��}|�|��S)zJ
        Check what passed version isn't used any web-application
        r)�ApplicationsManager)�$clselect.clselectpython.apps_managerr8�is_version_in_use)rr8�apps_managers   r�_is_version_in_usezPkgManager._is_version_in_usezs9��	M�L�L�L�L�L�*�*�,�,���-�-�g�6�6�6rN)�__name__�
__module__�__qualname__�__doc__rr
�_config_dir�_yum_cmdr�
_alt_names�
_redirect_logr#r2r5rr r,r0r3r6�staticmethodr<�rrrrs��������
����K�;�H��J�7�M��7�7����E��	���L��'�'����E��	���K�&�&�&�&�&�&����.!�!�!�B�B�B�A�A�A��7�7��\�7�7�7rr)�
__future__rrrr(� clselect.baseclselect.pkgmanagerrrrr	r
rrr
rrFrr�<module>rIs���&�%�%�%�%�%�������&�&�&�&�&�&�	�	�	�	�;�;�;�;�;�;�����������������k7�k7�k7�k7�k7��k7�k7�k7�k7�k7r

Hacked By AnonymousFox1.0, Coded By AnonymousFox