Hacked By AnonymousFox
�
!�gy� � �D � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
Z
d dlZd dlmc mc mZ d dlmZ d dlmZ ddlmZ dd lmZ dd
lmZ d dlZd dlmZm Z m!Z!m"Z" d dl#m$Z$m%Z% d d
l&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3m4Z4 ddl5m6Z6m7Z7 dZ8dZ9dZ:dZ;dZ< ej= d� � Z>d� Z?d4d�Z@d5d�ZA d6d�ZBd� ZCd7d�ZDd5d �ZEd7d!�ZFd"� ZGd8d$�ZHd%� ZId5d&�ZJd7d'�ZKd7d(�ZLd7d)�ZMd*� ZNd+� ZOd,� ZPd-� ZQd.� ZRd/� ZSd9d1�ZTd:d3�ZUdS );� )�print_function)�absolute_import)�divisionN)�ConnectionError)� iteritems� )�clpassenger)�clselectctl)�utils)�userdomains�docroot�cpusers�CP_NAME)�NoDomain�NotSupported)�mod_makedirs)�ApplicationsManager�PythonAppFormatVersion�get_venv_rel_path)�ClSelectExcept�BaseClSelectException)�clprint)�
extensions�environments�interpreters)�APP_STARTED_CONST�APP_STOPPED_CONSTzpassenger_wsgi.py�started�applicationz�import imp
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
wsgi = imp.load_source('wsgi', '%s')
application = wsgi.%s
aH import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
def %s(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
message = 'It works!\n'
version = 'Python v' + sys.version.split()[0] + '\n'
response = '\n'.join([message, version])
return [response.encode()]
zJimp\.load_source\(.+, '(?P<script>.+)'\)\s+application.+\.(?P<callable>.+)c � � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d � � t d
� � t d� � t d� � t d
� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � t d� � d S )Nz�Warning: selectorctl utility for --interpreter python is deprecated. Only update-interpreter option is still possible to use.
Please, use cloudlinux-selector utility to manage your python applicationszF -v | --version VERSION : Specify alternative versionz3 -u | --user USERNAME : Usernamez^ --domain DOMAIN : Domain (or subdomain); users main domain as defaultzL -l | --list : List alternatives for interpreterzF -G | --list-extensions : List global set of packageszG -K | --list-extensions-version : List version set of packageszG -s | --user-summary : List user summary of webappsz= -y | --create-webapp : Create user webappzi | --update-interpreter : Update binary python in virtual environment; you can use with zj --user=* for all users; application name as default * (all app)z> -n | --destroy-webapp : Destroy user webappza -f | --relocate-webapp : Change webapp directory (files must be moved manually)zE -F | --transit-webapp : Change webapp domain/aliasz9 -Z | --restart-webapp : Restart webappz6 -t | --stop-webapp : Stop webappz^ -c | --user-current : Show currently selected alternative for user webappzQ -b | --set-user-current : Set alternative as user webapp defaultzc -e | --enable-user-extensions PACKAGES : Install comma-separated list of packages for user webappze -d | --disable-user-extensions PACKAGES : Uninstall comma-separated list of packages for user webappzK : Use '-' (minus) for all packageszb -r | --replace-user-extensions PACKAGES : Update comma-separated list of packages for user webappzN --recreate-virtualenv : Recreate python virtual environmentzX --freeze-requirements : Freeze virtual environment installed packageszR -g | --list-user-extensions : List installed packages for user webappz5 -o | --setup-wsgi WSGI[:CALLABLE] : Setup wsgizZ -p | --print-summary : If specified along with setting an alternative z> prints user summaryz= -j | --json : Print data as JSONzO | --verbose : show detail information about action)�print� � �Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectctlpython.py�usager% R s� � � � Y� Z� Z� Z�
�
R�S�S�S� �
?�@�@�@� �
j�k�k�k� �
X�Y�Y�Y� �
R�S�S�S� �
S�T�T�T� �
S�T�T�T� �
I�J�J�J� �
u�v�v�v� �
v�w�w�w� �
J�K�K�K� �
m�n�n�n� �
Q�R�R�R� �
E�F�F�F� �
B�C�C�C� �
j�k�k�k� �
]�^�^�^� �
o�p�p�p� �
q�r�r�r� �
W�X�X�X� �
n�o�o�o� �
W�X�X�X� �
Z�[�[�[� �
d�e�e�e� �
^�_�_�_� �
A�B�B�B� �
f�g�g�g� �
J�K�K�K� �
I�J�J�J� �
[�\�\�\�\�\r# Tc � � t | |� � \ }}|s|}t j || |� � }|� � � r|st j |j � � �|� � � sT t j d�� � | }n"# t $ r t j |� � �w xY w|�
|� � |S )a#
Create new environment (or use existing if use_existing=True)
:param user: unix user name that app belongs to
:param directory: app root
:param version: python version
:param env_name: DEPRECATED
:param use_existing: do not raise exception if env already exists
�version��key)r r �Environment�existsr �EnvironmentAlreadyExists�pathr �KeyError�NoSuchAlternativeVersion�create) �user� directoryr'