%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/clselect/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyc

�
i�B^c	@`s4ddlmZddlmZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddljjjZddlmZddlmZddlmZdd	lmZdd
lmZddlZddlmZm Z m!Z!m"Z"ddl#m$Z$m%Z%dd
l&m'Z'm(Z(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddl/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5dZ6dZ7dZ8dZ9dZ:ej;d�Z<d�Z=e>e?d�Z@e>e>d�ZAe>e>e>e>e>e>e>e>d�ZBd�ZCe>d�ZDe>e>d�ZEe>d�ZFd �ZGe>e>eHe>d!�ZId"�ZJe>e>d#�ZKe>d$�ZLe>d%�ZMe>d&�ZNd'�ZOd(�ZPd)�ZQd*�ZRd+�ZSd,�ZTd-d.�ZUd-d/d0d1fd-e?d2�ZVdS(3i(tprint_function(tabsolute_import(tdivisionN(tConnectionError(t	iteritemsi(tclpassenger(tclselectctl(tutils(tuserdomainstdocroottcpuserstCP_NAME(tNoDomaintNotSupported(tApplicationsManagertPythonAppFormatVersiontget_venv_rel_path(tClSelectExcepttBaseClSelectException(tclprint(t
extensionstenvironmentstinterpreters(tAPP_STARTED_CONSTtAPP_STOPPED_CONSTspassenger_wsgi.pyustartedtapplications�import imp
import os
import sys


sys.path.insert(0, os.path.dirname(__file__))

wsgi = imp.load_source('wsgi', '%s')
application = wsgi.%s
sHimport 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()]
sJimp\.load_source\(.+, '(?P<script>.+)'\)\s+application.+\.(?P<callable>.+)cC`s:td�td�td�td�td�td�td�td�td	�td
�td�td�td
�td�td�td�td�td�td�td�td�td�td�td�td�td�td�td�td�td�td�dS(Ns�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 applicationssF -v | --version VERSION                  : Specify alternative versions3 -u | --user USERNAME                    : Usernames^      --domain DOMAIN                    : Domain (or subdomain); users main domain as defaultsL -l | --list                             : List alternatives for interpretersF -G | --list-extensions                  : List global set of packagessG -K | --list-extensions-version          : List version set of packagessG -s | --user-summary                     : List user summary of webappss= -y | --create-webapp                    : Create user webappsi    | --update-interpreter               : Update binary python in virtual environment; you can use with sj                                           --user=* for all users; application name as default * (all app)s> -n | --destroy-webapp                   : Destroy user webappsa -f | --relocate-webapp                  : Change webapp directory (files must be moved manually)sE -F | --transit-webapp                   : Change webapp domain/aliass9 -Z | --restart-webapp                   : Restart webapps6 -t | --stop-webapp                      : Stop webapps^ -c | --user-current                     : Show currently selected alternative for user webappsQ -b | --set-user-current                 : Set alternative as user webapp defaultsc -e | --enable-user-extensions PACKAGES  : Install comma-separated list of packages for user webappse -d | --disable-user-extensions PACKAGES : Uninstall comma-separated list of packages for user webappsK                                         : Use '-' (minus) for all packagessb -r | --replace-user-extensions PACKAGES : Update comma-separated list of packages for user webappsN      --recreate-virtualenv              : Recreate python virtual environmentsX      --freeze-requirements              : Freeze virtual environment installed packagessR -g | --list-user-extensions             : List installed packages for user webapps5 -o | --setup-wsgi WSGI[:CALLABLE]       : Setup wsgisZ -p | --print-summary                    : If specified along with setting an alternative s>                                           prints user summarys= -j | --json                             : Print data as JSONsO    | --verbose                          : show detail information about action(tprint(((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytusageQs>





























c	C`s�t||�\}}|s$|}ntj|||�}|j�ra|ratj|j��n|j�s�ytjdd�|}Wn tk
r�tj	|��nX|j
|�n|S(s#
    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
    tkeytversion(RRtEnvironmenttexistsRtEnvironmentAlreadyExiststpathRtKeyErrortNoSuchAlternativeVersiontcreate(	tusert	directoryRtenv_nametuse_existingt_tprefixtenvironmenttinterpreter((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt_create_environmentus		
c	C`s|dkrt�}ny8|r.|d}n!|j||tj|�j�}WnXtjk
r�tj	|�j
|�}|dkr�tjd|��n|d}nXtj
jtj
jtj
j|���}t||�\}}tj|||�}|S(Ntbinarys8No such application (or application not configured) "%s"(tNoneRtget_binary_pathtpwdtgetpwnamtpw_dirRtConfigMissingErrorRtsummarytgettWebAppErrortosR!tbasenametdirnameRRR(	R%R&tapp_summarytapps_managerR.R'R)R*R+((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt_get_environment�s
%*c
C`s�|	dkrt�}	n|dkr6tjd��ntj|�}tj|�}ytj	|||�}Wnt
k
r�nXtj|d��t|||dt
�}
|
j�j}tj||||	j|d|d|
�tj||�|rt|}n	tj}|r�|tkr�t|||�}tjj|�}tjj|�sjtj|d�ntj||�|r�t||||�q�nDt}t|||�}tj||�|r�t||||�n|s�i}n|s�t}n|s2tj|�}tj	|||�}|d}ni	|d6tj d	6|d
6|d6t!d6|d
6gd6|d6|d6}|
r�|
|d<n|	j"|||�y|	j#||||�Wn7t$k
r�}t%j&didd6t'|�d6�nXdS(s�
    Create new python application
    :param user: unix user name
    :param directory: application path in user's home (app-root)
    :param alias: alias (app-uri)
    :param version: version of interpreter
    :param doc_root: doc_root
    :param env_vars: dict with environment variables
    :param startup_file: main application file
    :param domain_name: domain name
    :param entry_point: application entry point
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :param passenger_log_file: Passenger log filename to write to app's .htaccess
    :return: None
    sNot passed version as argumentR&R(tdoc_roottpassenger_log_filei�tdomainupython_versionuapp_versionudomainuapp_uriu
app_statusustartup_fileuconfig_filesuenv_varsuentry_pointupassenger_log_filettexttERRORtstatustmessageN((R/RRt	WrongDataRt	get_aliasRR5Rtget_using_realpath_keysR"tAppRootBusyR-tFalseR,R.t	configuretINTERPRETERtrestartt_CONFIGURABLE_WSGI_TEMPLATEt
WSGI_TEMPLATEtDEFAULT_STARTUP_FILEt_get_full_path_to_startup_fileR8R!R:Rtmakedirst
file_writet
setup_wsgitDEFAULT_APP_ENTRYPOINTRtSTABLEtDEFAULT_APP_STATEtadd_app_to_configtadd_env_vars_for_htaccesst	ExceptionRt
print_diagtstr(R%R&taliasRR>tenv_varststartup_filetdomain_nametentry_pointR<R?tuser_summaryR;R+R.tcontenttstartup_file_nametdir_nametsummary_datatapp_dataterr((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyR$�sr
!
			



cC`sAddlm}|j�j|�s=tj||d��ndS(s�
    Check whether particular interpreter version is enabled and raises
    exception if not
    :param user: user to include in exception
    i(tpython_managersversion is not enabledN(tclselectpythonRht
PythonManagertis_version_enabledRtUnableToSetAlternative(RR%Rh((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt_ensure_version_enabled
scC`s�d}d}d}tjjjtj�t|�sFtjd��ndj	d|d|�}ytj
|dt�}Wnctk
r�|j
d	d
�}ytj
|dt�}Wq�tk
r�tj||��q�XnX|jj
d�}|jj
d�}	|�ytj
|dt�}Wn$tk
rGtj||��nX|jj
d�}
|jj
d�}|j�|
j�ks�|	|kr�|	dk	r�|	d
 dks�|dk	r�|d
 dkr�tj||||
f��ndS(s@
    Check response from user's webapp before and after calling action.
    Also compare both responses
    :param domain: domain associated with webapp
    :param alias: URI associated with webapp
    :param action: called action, that make something with webapp: install modules, transit it, etc
    :return: None
    sTWeb application is inaccessible by its address "%s". The operation wasn't performed.s�The operation was performed, but check availability of application has failed. Web application is inaccessible by its address "%s" after the operation.s�The operation was performed, but check availability of application has failed. Web application responds, but its return code "%s" or content type before operation "%s" doesn't equal to contet type after operation "%s".s+Wrong action for calling in checking webappshttps://{domain}/{alias}R@R\tverifyshttps://shttp://sContent-TypetStatusit500N(trequeststpackagesturllib3tdisable_warningsturllib_exceptionstInsecureRequestWarningtcallableRREtformatR6RIRtreplaceR7theaderstlowerR/(R@R\tactiontapp_is_inaccessible_beforetapp_is_inaccessible_aftert
app_is_brokent
webapp_urltrequesttbefore_mime_typet
before_statustafter_mime_typetafter_status((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytcheck_response_from_webapps<
		


(cC`s�|dkrtjd��n|dkr<tjd��n|d}t|�}g|D]+\}}tj|||d�rY|^qY}t|�dkr�tjd��n|d}||fS(s�
    Get info (alias and domain) about user's web application
    :param app_summary: dict -> summary info about user's web application
    :param user: str -> name of unix user
    :return: tuple -> (alias, domain)
    s3Was passed incorrect summary info about applications!Was passed incorrect name of userR\R	is-Can not found suitable domain for applicationN(R/RRERRtrealpaths_are_equaltlen(R;R%R\tuser_domainsR@R>t
found_domainst
app_domain((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt_get_info_about_webappJs
%
cC`sK|dkrt�}n|j||�}y|j||d|�Wn7tk
r}}tjdidd6t|�d6�nX|dk	r>|jd�t	kr>t
j|�j}t
jj|t||�d�}ytj|�Wntk
r�nX|j|||�}tj|�|j||�tj||�dStj|�}	|j||�}
ytj|||	�Wn.tk
r�|
r�dStjd|��nXt||d	|�j }tj!||�\}}
ytj|�Wntk
r�nXtj"||�tj||�ytj||�Wntj#k
rFnXdS(
sa
    Destroy web app with specified directory for specified user
    :param user: username
    :param app_directory: application directory
    :param doc_root: Document root for selected domain
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :return: None
    RARBRCRDt
app_statusiNs8No such application (or application not configured) "%s"R<($R/Rtget_app_configRXRYRRZR[R6RR1R2R3R8R!tjoinRtshutiltrmtreetOSErrortget_htaccess_by_appdirRt$remove_passenger_lines_from_htaccesstremove_app_from_configRLR5RRGR"RRER=R*tget_abs_reltunconfiguretMissingApprootDirectory(R%t
app_directoryR>R<t
app_configRgt	user_hometvirtual_env_paththtaccess_filenameRat
app_in_configR*tabs_dirR)((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytdestroybsT(!	


	
c`setj|�}tj|tj�\}}x4tjtjj	|dd��D]�xtjtjj	�dd��D]�}tjj
|�r�qtntj|�}g}d|krx}|j�D]@}d|kr�t
jd�fd�|�}n|j|�q�Wn,|jd�r3|j�}d�|d<n|rttj|d	�|D�d
�qtqtWqLWdS(Nt*tbintVIRTUAL_ENVsVIRTUAL_ENV."(.+)"$c`s"|jd�j|jd���S(Nii(tgroupRy(tm(tenv(sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt<lambda>�ts#!s#!%s/bin/pythonics`s|]}d|VqdS(s%s
N((t.0tline((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pys	<genexpr>�stw(Rtget_userRR�RtDEFAULT_PREFIXtglobR8R!R�tislinkt	file_readt
splitlinestretsubtappendt
startswithtfile_writelines(R%tenvsR)tscriptt
old_scriptt
new_scriptR�((R�sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytfix_homedir�s*((c
`s&|d
krt�}ntj|�}|j|�}ytj|�|�}Wn)tk
rztj	dj
����nX|dtkr�t}nt
|�d|������fd�}|sy%td|dd|dd|�Wq"tjk
r}	tjd	|	��q"Xn|�d
S(s
    Install defined extension to python web application
    :param requirements_path: path to the text file with list of python modules for installation
    :param user: name of owner of web application
    :param directory: application's root
    :param extension: name of installed module
    :param skip_web_check: skip check web application after change it's properties
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :return: None
    s%Record about application {} is absentR�R<c`sK�dk	r�j��n+�dk	rG�jtjj����ndS(N(R/textension_installtextension_install_requirementsR8R!R�((R&R+t	extensiontrequirements_path(sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyR|�sR@R\tapp_uriR|s3An error occured during installation of modules. %sN(R/RRR�tget_user_config_dataRRGR"RRERxRtTrueR=R�R7(
R%R&R�R�tskip_web_checkR<tuser_configRfR|Rg((R&R+R�R�sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytinstall�s*

	

cC`s(tj|�}t||�}|j�S(N(RR�R=R(R%R&R+((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytlist_extensions�scC`s�|dkrt�}n|j||�}|dk	rm|jd�tkrm|dk	r�t|||�q�n1tj|�}||kr�tj	d|��ntj
||�dS(sb
    Restarts web app with specified directory for specified user
    :param user: username
    :param app_directory: application directory
    :param doc_root: Document root for selected domain
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :return: None
    R�s8No such application (or application not configured) "%s"N(R/RR�R6RtstartRR5RRERL(R%R�R>R<R�tapps_summary((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyRL�s!cC`s�|dkrt�}n|j||�}|dkrLtjd|��n|jd�tkredS|j||||�}tj	|�|j
||t�tj||�dS(s_
    Stops web app with specified directory for specified user
    :param user: username
    :param app_directory: application directory
    :param doc_root: Document root for selected domain
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :return: None
    s8No such application (or application not configured) "%s"R�N(R/RR�RRER6RR�RR�tset_app_statusRL(R%R�R>R<R�R�((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytstops	

cC`s�|dkrt�}n|j||�}|dkrLtjd|��n|jd�tkredS|j|||�|j||t�t	j
||�|jd�}|tkr�t|||jd��}t
||||jd��ndS(s`
    Starts web app with specified directory for specified user
    :param user: username
    :param app_directory: application directory
    :param doc_root: Document root for selected domain
    :param apps_manager: Application Manager. Class that responsible
           for gathering and writing information about applications
    :return: None
    s8No such application (or application not configured) "%s"R�NR^R`(R/RR�RRER6Rtupdate_htaccess_fileR�RRLRORPRS(R%R�R>R<R�R^tstartup_file_full_path((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyR�7s$	
cC`s9tj|�}tj||�\}}tj|�}||krXtjd|��ntj	j
|�r�tj	j|�s�tjd|��ntj||�dj
tj	j�}|s�tjd��q�ntjd��tj	j|tj�}|st}ntj|t||fd�tj||�dS(Ns8No such application (or application not configured) "%s"sNo such WSGI script "%s"is&WSGI script is not in webapp directorys$Path to WSGI script must be absoluteR�(RR�RR�RR5RRER8R!tisabstisfilets_partitiontstriptsepR�t	WSGI_PATHRTRRRNRL(R%R&t	wsgi_pathtcallable_objectR�R)R�tapp_wsgi((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyRS^s"%	cC`s7tj|�j}tjj|d�}tjj|�S(s9
    return True if user home dir has virtualenv dir
    t
virtualenv(R1R2R3R8R!R�tisdir(R%thomedirR!((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pythas_virtenv_dirvsc
C`s�tj|�}i}t|�s%|Sx}ttj|��D]f\}}|dtjkr`q;nyt|||�j	�}t
jj|dtj
�}tj|�}tj|�}|r�|j�}|d}	|d}
n
d}	}
i|dd6|dd6|dd	6|dd6|d
d
6i|	d6|
d6d6}d|krmt|d�d
krm|d|d<nWn&tk
r�}it|�d6}nX|||<q;W|S(NR,R&R�RwR�R\R@tnameR+Rtwsgitdomainsiterror(RR�R�RRR5RRKR=tas_deepdictR8R!R�R�RR�tWSGI_PATTERNtsearcht	groupdictR�RYR[(
R%tsummR&tdataR+R�t	wsgi_conftmatchR�R�R�tenv_infote((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyR5s<"


"cC`s+tj||�\}}tjj||�S(s�
    :param user: name of system user
    :param directory: name of dir with python applicatoin
    :param startup_file: name of startup file of python application
    Get full path to startup file of python application
    (RR�R8R!R�(R%R&R^R�trel_dir((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyRP�s	cC`s/tj|�}t||�}|j|�dS(N(RR�R=textension_uninstall(R%R&R�R+((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt	uninstall�scC`s/tj|�}t||�}|j|�dS(N(RR�R=textension_update(R%R&R�R+((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytupdate�sc" `s�y}tjtjddddddddd	d
ddd
ddddddddddddddddddg�\}}Wn@tjk
r�}tjjt|��t�tjd�nXd }d!}t	}t	}d}d}d }	d}
|s
t�tjd�ndy�t�fd#�|D��s]tj
|id$d%6d&d'6�tjd�nx�|D]�\}}|dzkrqd|d{kr�d}	qd|d|kr�d}	qd|d"kr�d}	qd|d}kr�d
}	qd|d~kr�d}	qd|dkr�d}	qd|d�krd}	qd|d�kr'd}	qd|d�kr<d}	qd|d�krQd}	qd|d�krfd}	qd|d�kr{d}	qd|d�kr�dB}	|}qd|d�kr�d}	|}qd|d�kr�d}	|}qd|d�kr�d
}	qd|d�kr�d}qd|dIkrt}qd|d�kr&dL}	|}qd|d�krAdO}	|}qd|d�krV|}
qd|d�krkd	}	qd|d�kr�|jdV�}qd|dWkr�|}qd|d�kr�dZ}	tj|d[�\}
}}qd|d�kr�t}qd|d�kr�d`}	|}qdtjjda�tjd�qdW|	d krKtjjdb�tjd�n|	d�kr�|s�tjjdc�tjdd�q�n|dekr�|	dBkr�tjjdf�tjdg�q�n1|r�g|jdh�D]}|r�|^q�}n|r�yt|�\}}Wntk
rJtj
|id$d%6di|d'6�tjd�n@tk
r�tj
|id$d%6djtd'6�tjd�nX|s�|}q�||kr�tj
|id$d%6dk||fd'6�tjd�q�n�|	d�krFytj|�}WqFtk
rB}tj
|id$d%6|jd'6�tjd�qFXn|r�|	dkr�yt|�}Wn@tk
r�tj
|id$d%6djtd'6�tjd�nX|dl\}}ny�dl}dl}i}|	d	kr�tdm|	��n�|	d`krtj�j|�}d }n�|	dkr;t j!dn�}n|	d
krVt"|�}nd|	dkr�t#||dl|d|
do|�n4|	dkr�dp}t$|�dkr�|dljdV�}nt%dq|dr|dn|
fd|�n�|	d
krt&||dl|�n�|	dkr'tdm|	��n�|	dkr[d}|rH|}ntdm|	��n_|	dkr~t'||dl|�n<|	dkr�t(||dl|�n|	dkr�t)||dl|�n�|	dkr�tdm|	��n�|	dkr	tdm|	��n�|	dkr$	t*||dl�}n�|	dZkrJ	t+||dl|
|�np|	dkrz	xat,j,�D]}|j-�qc	Wn@|	dkr�	x1t,j,�D]}|j.�q�	Wn|dl}|dekr�	t*||�}nx�|D]�}y�|	dBkr
t/|||�n>|	dOkr 
t0|||�n|	dLkr?
t1|||�n|j1iidsd%6|6�|d7}Wq�	tt2j3fk
r�
}|j1iid$d%6t|�d'6|6�|d7}q�	Xq�	WWn�t4tj5fk
r}tj
|id$d%6|jd'6�tjd�n�tk
rFtj
|id$d%6djtd'6�tjd�nMt6k
r�}t7j8|�}tj
|id$d%6|d'6�tjd�nX|r�|r�t"|�}n|r�|r�dt}du} nv|r�d$}dv} na|r#|dukr#|rtj9|t"|��q3tj9|i�ntj9||�tjdl�dwj:dx�t;|�D��}!tj
|i|d%6|!d'6�tj| �dS(�Nishi:v:u:lGsynfFZtcbe:d:r:go:pjK:thelpsinterpreter=sversion=suser=sdomain=tlistslist-extensionssuser-summarys
create-webappsupdate-interpretersdestroy-webappsrelocate-webappstransit-webappsrestart-webappsstart-webappsstop-webappsuser-currentsset-user-currentsenable-user-extensions=sdisable-user-extensions=sreplace-user-extensions=srecreate-virtualenvsfreeze-requirementsslist-user-extensionsssetup-wsgi=s
print-summarytjsontverboseslist-extensions-version=R�RAs--update-interpreterc3`s|]}|d�kVqdS(iN((R�titem(tallowed_opts(sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pys	<genexpr>�sRBRCs�Unsupported option was passed. Currently, selectorctl utility supports only update-interpreter option. Please, use cloudlinux-selector utility for python interpreterRDs-is
--interpreters-ls--lists-ys--create-webapps-ns--destroy-webapps-fs--relocate-webapps-Fs--transit-webapps-Zs--restart-webapps-Ss--start-webapps-ts
--stop-webapps-cs--user-currents-bs--set-user-currents-gs--list-user-extensionss-es--enable-user-extensionssenable-user-extensionss--recreate-virtualenvs--freeze-requirementss-ss--user-summarys-js--jsons	--verboses-rs--replace-user-extensionssreplace-user-extensionss-ds--disable-user-extensionssdisable-user-extensionss-vs	--versions-Gs--list-extensionss-us--users'"s--domains-os--setup-wsgis
setup-wsgit:s-ps--print-summarys-Ks--list-extensions-versionslist-extensions-versionsunhandled options4ERROR:you must provide option for interpreter pythonswebapp must be specifiedit-s.installation of all extensions is not possibleit,sNo such domain: "%s"s$Python selector not supported for %ss)domain "%s" is not owned by the user "%s"is'%s is deprecated in old python selectorRR>R�R%tapp_nametOKtPARTIALiis
cs`s=|]3\}}d||jd|jdd��fVqdS(s%s: %sRDRCR�N(R6(R�tktv((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pys	<genexpr>�s(s--update-interpreter(s-is
--interpreter(s-ls--list(s-ys--create-webapp(s-ns--destroy-webapp(s-fs--relocate-webapp(s-Fs--transit-webapp(s-Zs--restart-webapp(s-Ss--start-webapp(s-ts
--stop-webapp(s-cs--user-current(s-bs--set-user-current(s-gs--list-user-extensions(s-es--enable-user-extensions(s--recreate-virtualenv(s--freeze-requirements(s-ss--user-summary(s-js--json(s-rs--replace-user-extensions(s-ds--disable-user-extensions(s-vs	--version(s-Gs--list-extensions(s-us--user(s-os--setup-wsgi(s-ps--print-summary(s-Ks--list-extensions-version(s
create-webappsdestroy-webappsrelocate-webappstransit-webappsrestart-webappsstart-webappsstop-webappsenable-user-extensionsslist-user-extensionssreplace-user-extensionssdisable-user-extensionss
setup-wsgisuser-currentsset-user-current(s
create-webappsdestroy-webappsrelocate-webappstransit-webappsrestart-webappsstart-webappsstop-webappsenable-user-extensionsslist-user-extensionssreplace-user-extensionssdisable-user-extensionss
setup-wsgisuser-summarysupdate-interpretersuser-currentsset-user-current(<tgetopttsystargvtGetoptErrortstderrtwriteR[RtexitRIR/tanyRRZR�R�RR�tsplitR	RR
RRR�t
ValueErrorRDRtDeprecationWarningRt
ExtensionInfotlist_extensions_versionRtinterpreters_dictR5R$R�tupdate_interpreterR�RLR�R�R�RSRtrecreatet
pip_freezeR�R�R�RtExternalProgramFailedRtPyPIRpcApiErrorRYt	tracebackt
format_exct
print_dataR�R("toptstargsRgtext_listtfmtR�t
print_summaryR%R@R|RtotaR�R)R�t_ft_extsR>tuser_R�tdomain_listR�toktresultR�tnew_doc_rootR�R\R�tmsgRCtexit_statusRD((R�sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pytmain�s8
																										+
"
"	(	!
"	$%	

"!
"
		
R�cC`s,gt�D]}tj||�r
|^q
S(sL
    Return filtered control panels users
    :param user:
    :return:
    (R
tfnmatch(R%t	user_name((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt_glob_usersss2.7s3.3s3.4cC`sUtj�r$tjjdt�dStjdd�}tj�}t�}xt	|�D]�}|ryt
j|�ryqXnt|�s�qXnt
j|�}tj�}	tj�}
tj|j|	�tj|j|
�tj�xNt|j|��D]7\}}tj||�sq�ny�t||d|�}
|
j�j}||krUw�n|rrtd||f�n|
jdt d|dt!d	|�}|r�yt"||�Wq�t#t$fk
r�}|r�td
|t%|�f�q�q�XnWq�t&j'k
r.}|r/td||t%|�f�q/q�Xq�Wtj(|	�tj)|
�qXWdS(NsNWARNING: Update interpreter with Python selector not supported on %s, skipped
RRR<s)Updating user: "%s"; application: "%s"...tbackupR�tforcet_alt_interpreters_dicts&Failed to restart application "%s"; %ss1Failed updating user: "%s"; application: "%s"; %s(*tdetecttis_pleskR�R�RRRtdetect_DA_adminRR$Rtuser_should_be_skippedR�R1R2R8tgetuidtgetgidtsetregidtpw_gidtsetreuidtpw_uidtsecureiotset_capabilityRR�R"R=R,RRtupdate_python_interpreterR�RIRLR�tIOErrorR[RtInterpreterErrortsetuidtsetgid(R%RR�R�talt_interpreters_dicttis_da_panelR<R#tuser_pwdtreal_uidtreal_gidt	app_name_R�R+tenv_python_vert
update_resultR�((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyR	
sP	
"	((
(Wt
__future__RRRR�R�R8R�R�R�R1R"R2RRqt$requests.packages.urllib3.exceptionsRrRst
exceptionsRutrequests.exceptionsRtfuture.utilsRR�RRRtcldetectlibR(tclcommon.cpapiRR	R
Rtclcommon.cpapi.cpapiexceptionsRR
tclselectpython.apps_managerRRRtclselectexceptRRt
clselectprintRtclselectpythonuserRRRtbaseclselectRRRORVRTRNRMtcompileR�RR/R�R-R=R$RmR�R�R�R�RIR�R�RLR�R�RSR�R5RPR�R�R!R$R	(((sK/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectctlpython.pyt<module>sv"	$f	4I	.	'			*	
			�B	

Zerion Mini Shell 1.0