403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.108
Web Server : Apache
System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib/python3.9/site-packages/virtualenv/create/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.9/site-packages/virtualenv/create/__pycache__/creator.cpython-39.opt-1.pyc
a

��:i< �@s�ddlZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZeej�e��jZed
ZGdd�d�ZGdd�ded�Z dd�Z!ddgZ"dS)�N)�ABCMeta�abstractmethod)�ArgumentTypeError)�literal_eval)�OrderedDict)�Path)�LogCmd)�safe_delete)�run_cmd)�__version__�)�PyEnvCfgzdebug.pyc@seZdZdd�ZdS)�CreatorMetacCs
d|_dS�N)�error��self�r�=/usr/lib/python3.9/site-packages/virtualenv/create/creator.py�__init__szCreatorMeta.__init__N)�__name__�
__module__�__qualname__rrrrrrsrc@s�eZdZdZdd�Zdd�Zdd�Zedd	��Zed
d��Z	e
dd
��Zedd��Zdd�Z
dd�Zdd�Zedd��Zedd��ZdS)�CreatorzEA class that given a python Interpreter creates a virtual environmentcCsJ||_d|_t|j�|_|j|_|j|_t�|j�|_|j	|_	|j
|_
dS)z�Construct a new virtual environment creator.

        :param options: the CLI option as parsed from :meth:`add_parser_arguments`
        :param interpreter: the interpreter to create virtual environment from
        N)�interpreter�_debugr�dest�clear�
no_vcs_ignorer
Zfrom_folder�	pyenv_cfg�app_data�env)r�optionsrrrrrszCreator.__init__cCs(|jj�dd�dd�|��D���d�S)N�(z, css |]\}}|�d|��VqdS)�=Nr)�.0�k�vrrr�	<genexpr>.�z#Creator.__repr__.<locals>.<genexpr>�))�	__class__r�join�_argsrrrr�__repr__-szCreator.__repr__cCs dt|j�fd|jfd|jfgS)Nrrr)�strrrrrrrrr-0s�z
Creator._argscCsdS)aDetermine if we can create a virtual environment.

        :param interpreter: the interpreter in question
        :return: ``None`` if we can't create, any other object otherwise that will be forwarded to                   :meth:`add_parser_arguments`
        Tr)�clsrrrr�
can_create7szCreator.can_createcCs>|jdd|jd�|jdddddd	�|jd
ddddd	�d
S)aAdd CLI arguments for the creator.

        :param parser: the CLI parser
        :param app_data: the application data folder
        :param interpreter: the interpreter we're asked to create virtual environment for
        :param meta: value as returned by :meth:`can_create`
        rz!directory to create virtualenv at)�help�typez--clearr�
store_truezZremove the destination directory if exist before starting (will overwrite files otherwise)F)r�actionr2�defaultz--no-vcs-ignorerz>don't create VCS ignore directive in the destination directoryN)�add_argument�
validate_dest)r0�parserr�metar rrr�add_parser_argumentsAs&	���zCreator.add_parser_argumentscCst�dS)z)Perform the virtual environment creation.N)�NotImplementedErrorrrrr�create^szCreator.createc	Cs�dd�}t��}t�}|dkr&ddini}t|�D]P}z0|j|fi|���|�}||kr\Wq2t|��Wq2ty�d||<Yq20q2|r�d�|���}d|�d	|�d
|��}	t	|	��t
j|vr�d|�dt
j�d
�}	t	|	�d���t|�}
|
�
��r|
���rt	d|
�d���tt
j�t|
�����}|}
|�r�|�
��r\t
�t|�t
j��rR�q�n
|||
�|j|j}}
||k�r~|||
�|}�q(t|
�S)zANo path separator in the path, valid chars and must be write-ablecSs6ttj�|j|jg��}td|�|��d|����dS)N�the destination z is not write-able at )r�os�path�commonprefix�partsr�relative_to)r�value�commonrrr�non_write_ablegsz-Creator.validate_dest.<locals>.non_write_able�mbcs�errors�ignoreN�zthe file system codec (z) cannot handle characters z within zdestination z& must not contain the path separator (r*z+ as this would break the activation scriptsr>z already exists and is a file)�sys�getfilesystemencodingrr/�encode�decode�
ValueErrorr,�keysrr?�pathsepr�exists�is_filer@�abspath�resolve�access�W_OK�parent�name)r0Z	raw_valuerF�encodingZrefused�kwargs�charZtripZbad�msgrDr�base�_rrrr8csD




zCreator.validate_destcCsJ|j��r(|jr(t�d|j�t|j�|��|��|jsF|�	�dS)Nz	delete %s)
rrRr�logging�debugr	r=�
set_pyenv_cfgr�setup_ignore_vcsrrrr�run�s
zCreator.runcCsbt�|j_tj�tj�|jj��|jd<|jj	|jd<d�
dd�|jjD��|jd<t|jd<dS)N�home�implementation�.css|]}t|�VqdSr)r/)r%�irrrr(�r)z(Creator.set_pyenv_cfg.<locals>.<genexpr>�version_infoZ
virtualenv)
rrZcontentr?r@�dirnamerTrZsystem_executablerfr,rirrrrrrb�s

zCreator.set_pyenv_cfgcCs$|jd}|��s |jddd�dS)z9Generate ignore instructions for version control systems.z
.gitignorez(# created by virtualenv automatically
*
zutf-8)rZN)rrR�
write_text)rZ
git_ignorerrrrc�s
zCreator.setup_ignore_vcscCs4|jdur.|jdur.t|j|��|j|j�|_|jS)zt
        :return: debug information about the virtual environment (only valid after :meth:`create` has run)
        N)rZexe�get_env_debug_info�debug_scriptr r!rrrrra�sz
Creator.debugcCstSr)�DEBUG_SCRIPTrrrrrm�szCreator.debug_scriptN)rrr�__doc__rr.r-�classmethodr1r;rr=r8rdrbrc�propertyra�staticmethodrmrrrrrs&
	


-	
r)�	metaclassc

Cs"|��}|�dd�|�|��>}t|�t|�g}t�dt|��t|�\}}}Wd�n1sb0YzR|dkr�|r�t|�}q�|dkr�d|vr�t	|��t
|��n
t�|�}|r�||d<Wn8t
�y�}	z|||t
|	�d�WYd}	~	Sd}	~	00d|v�rd	|dv�r|dd	d=|S)
NZ
PYTHONPATHzdebug via %rr��file�err)�outrv�
returncode�	exceptionrKr@)�copy�popZensure_extractedr/r`rarr
r�OSError�	Exception�json�loads�repr)
Zenv_exermr r!�cmd�coderwrv�resultryrrrrl�s*,


(rl)#r~r`r?rK�abcrr�argparser�astr�collectionsr�pathlibrZ#virtualenv.discovery.cached_py_inforZvirtualenv.util.pathr	Zvirtualenv.util.subprocessr
Zvirtualenv.versionrrr
r@rT�__file__rXZHERErnrrrl�__all__rrrr�<module>s,!�

Youez - 2016 - github.com/yon3zu
LinuXploit