Edit File: python.cpython-311.pyc
� c|9eQ � � � d dl mZ d dlZd dlmZmZ ddlmZ d dlm Z m Z d dlmZm Z mZ d dlmZ d d lmZ d d lmZ G d� de� � ZdS ) � )�absolute_importN)�InstallationFailedException�PackageMissingError� )�WizardInstaller)�MODULES_LOGS_DIR�CL_SELECTOR_BIN)�ExternalProgramFailed�is_litespeed_running�get_passenger_package_name)�installed_interpreters_list)� get_ui_config)�Featurec � � � e Zd Zej � ed� � Zej Z � fd�Zd� Zd� Z ed� � � Zd� Zd� Zd� Zd � Zed � � � Z� xZS )�PythonInstallerz python.logc �V �� t t | � � � � � d S )N)�superr �__init__)�self� __class__s ��N/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/modules/python.pyr zPythonInstaller.__init__ s% �� � �o�t�$�$�-�-�/�/�/�/�/� c � � g }|D ]0}d|� dd� � z }|� |� � �1| j � dd� |� � � � | j |� dS # t $ r t � � �w xY w)zd Install given python versions :param versions: versions of python packages z alt-python�.� z/Try to install Python package with versions: %s�,N)�replace�append� app_logger�info�join�_install_yum_groupsr r )r �versions�groups�v�package_names r �_install_python_versionsz(PythonInstaller._install_python_versions# s� � � ��� (� (�A�'�!�)�)�C��*<�*<�<�L��M�M�,�'�'�'�'�����N�PS�PX�PX�Ya�Pb�Pb�c�c�c� 0�$�D�$�f�-�-�-�-��$� 0� 0� 0�-�/�/�/� 0���s �% A1 �1B c � � d}t j � |� � sdS | � d|g� � dS # t $ r t � � �w xY w)a In order to make python apps work on Litespeed server we need to do run extra script see docs for details: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cloudlinux:enable_passenger :return: z9/usr/local/lsws/admin/misc/enable_ruby_python_selector.shN�sh)�os�path�isfile�_run_commandr r )r �litespeed_scripts r �_configure_for_litespeed_serverz/PythonInstaller._configure_for_litespeed_server2 su � � W�� �w�~�~�.�/�/� ��F� 0����t�%5�6�7�7�7�7�7��$� 0� 0� 0�-�/�/�/� 0���s �>