https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/virtualenv/create/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/virtualenv/create/__pycache__/creator.cpython-310.pyc
o

$�"b�"�@s*ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZddlmZmZdd
lm Z ddl!m"Z"ddl#m$Z$eej%�&e'��j(Z)e)dZ*Gdd�de+�Z,ee	�Gdd�de+��Z-dd�Z.dS)�)�absolute_import�print_function�unicode_literalsN)�ABCMeta�abstractmethod)�ArgumentTypeError)�literal_eval)�OrderedDict)�dedent)�
add_metaclass)�LogCmd)�
WIN_CPYTHON_2)�Path�safe_delete)�
ensure_str�ensure_text)�run_cmd)�__version__�)�PyEnvCfgzdebug.pyc@seZdZdd�ZdS)�CreatorMetacCs
d|_dS�N)�error��self�r�;/usr/lib/python3/dist-packages/virtualenv/create/creator.py�__init__s
zCreatorMeta.__init__N)�__name__�
__module__�__qualname__rrrrrrsrc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	edd
��Z
edd��Zedd��Z
dd�Zdd�Zdd�Zedd��Zdd�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�from_folder�	pyenv_cfg�app_data�env)r�optionsr"rrrr%szCreator.__init__cCst|���Sr)r�__unicode__rrrr�__repr__4szCreator.__repr__cCs$d�|jjd�dd�|��D���S)Nz{}({})z, css �|]\}}d�||�VqdS)z{}={}N)�format)�.0�k�vrrr�	<genexpr>8s�z&Creator.__unicode__.<locals>.<genexpr>)r.�	__class__r�join�_argsrrrrr,7s$zCreator.__unicode__cCs$dtt|j��fd|jfd|jfgS)Nr$r%r&)r�strr$r%r&rrrrr5:s�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)�clsr"rrr�
can_createAszCreator.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`
        r$z!directory to create virtualenv at)�help�typez--clearr%�
store_truezZremove the destination directory if exist before starting (will overwrite files otherwise)F)r$�actionr9�defaultz--no-vcs-ignorer&z>don't create VCS ignore directive in the destination directoryN)�add_argument�
validate_dest)r7�parserr"�metar)rrr�add_parser_argumentsKs&	��
�zCreator.add_parser_argumentscCst�)z)Perform the virtual environment creation.)�NotImplementedErrorrrrr�createhszCreator.createc	Cs�dd�}t��}t�}|dkrddini}t|�D]%}z|j|fi|���|�}||kr.Wqt|��ty>d||<Yqw|rOtd�|d�	|�
��|���tj|vr]td	�|tj���t
|�}|��rp|��rptd
�|���dtjkr{dkr�nn	t
tj�|��}	nt
tj�t|�����}	|	}|	r�|	��r�t�tt|	��tj�r�	t|�S||	|�|	j|	j}
}|
|	kr�||	|�|
}	|	s�t|�S)
zANo path separator in the path, valid chars and must be write-ablecSs.ttj�|j|jg��}td�|�|�|���)Nz*the destination {} is not write-able at {})r�os�path�commonprefix�partsrr.�relative_to)r$�value�commonrrr�non_write_ableqs�z-Creator.validate_dest.<locals>.non_write_able�mbcs�errors�ignoreNzDthe file system codec ({}) cannot handle characters {!r} within {!r}�zddestination {!r} must not contain the path separator ({}) as this would break the activation scriptsz/the destination {} already exists and is a file)�rQ)rQ�)�sys�getfilesystemencodingr	r�encode�decode�
ValueErrorrr.r4�keysrE�pathsepr�exists�is_file�version_inforF�realpath�abspathr6�resolve�access�W_OK�parent�name)r7�	raw_valuerL�encoding�refused�kwargs�char�triprJr$�base�_rrrr?msZ���

�
�
�
zCreator.validate_destcCsN|j��r|jrt�d|j�t|j�|��|��|js%|�	�dSdS)Nz	delete %s)
r$rZr%�logging�debugrrD�
set_pyenv_cfgr&�setup_ignore_vcsrrrr�run�s
�zCreator.runcCsRt�|j_|jj|jd<|jj|jd<d�dd�|jjD��|jd<t|jd<dS)N�home�implementation�.css�|]}t|�VqdSr)r6�r/�irrrr2�s�z(Creator.set_pyenv_cfg.<locals>.<genexpr>r\�
virtualenv)	r	r(�contentr"�system_exec_prefixrrr4r\rrrrrrn�s

zCreator.set_pyenv_cfgcCs,|jd}|��s|�td����dSdS)z9Generate ignore instructions for version control systems.z
.gitignoreze
                    # created by virtualenv automatically
                    *
                    N)r$rZ�
write_textr
�lstrip)r�
git_ignorerrrro�s
���zCreator.setup_ignore_vcscCs4|jdur|jdurt|j|��|j|j�|_|jS)zt
        :return: debug information about the virtual environment (only valid after :meth:`create` has run)
        N)r#�exe�get_env_debug_info�debug_scriptr)r*rrrrrm�sz
Creator.debugcCstSr)�DEBUG_SCRIPTrrrrr~�szCreator.debug_scriptN)rrr �__doc__rr-r,r5�classmethodr8rBrrDr?rprnro�propertyrmr~rrrrr!!s(
	


9	
	r!c

Cs|��}|�td�d�|�|��*}t|�t|�g}tr#dd�|D�}t�td�t|��t|�\}}}Wd�n1s>wYz|dkrMt	|�}nt
�|�}|rX||d<Wntyt}	z|||t
|	�d�WYd}	~	Sd}	~	wwd|vr�d	|dvr�|dd	d=|S)
N�
PYTHONPATHcSsg|]}t|��qSr)rrtrrr�
<listcomp>�sz&get_env_debug_info.<locals>.<listcomp>zdebug via %rr�err)�outr��
returncode�	exceptionrSrF)�copy�popr6�ensure_extractedr
rlrmrrr�json�loads�	Exception�repr)
�env_exer~r)r*�cmd�coder�r��resultr�rrrr}�s.�

���r})/�
__future__rrrr�rlrErS�abcrr�argparser�astr�collectionsr	�textwrapr
�sixr�#virtualenv.discovery.cached_py_infor�virtualenv.infor
�virtualenv.util.pathrr�virtualenv.util.sixrr�virtualenv.util.subprocessr�virtualenv.versionrr(rrFr^�__file__rb�HEREr�objectrr!r}rrrr�<module>s27

https://t.me/RX1948 - 2025