AlkantarClanX12

Your IP : 13.58.45.238


Current Path : /opt/alt/python311/lib64/python3.11/venv/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/venv/__pycache__/__init__.cpython-311.pyc

�

c��f=b��2�dZddlZddlZddlZddlZddlZddlZddlZdZej	e
��ZGd�d��Z		d
d�Z
dd�Ze
d	krId
Z	e��dZn'#e$rZedezej���YdZ[ndZ[wwxYweje��dSdS)z�
Virtual environment (venv) package for Python. Based on PEP 405.

Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
�N)�pip�
setuptoolsc��eZdZdZ			dd�Zd�Zd�Zd�Zd�Zd	�Z	e
jd
krdd�Zndd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�
EnvBuildera�
    This class exists to allow virtual environment creation to be
    customized. The constructor parameters determine the builder's
    behaviour when called upon to create a virtual environment.

    By default, the builder makes the system (global) site-packages dir
    *un*available to the created environment.

    If invoked using the Python -m option, the default is to use copying
    on Windows platforms but symlinks elsewhere. If instantiated some
    other way, the default is to *not* use symlinks.

    :param system_site_packages: If True, the system (global) site-packages
                                 dir is available to created environments.
    :param clear: If True, delete the contents of the environment directory if
                  it already exists, before environment creation.
    :param symlinks: If True, attempt to symlink rather than copy files into
                     virtual environment.
    :param upgrade: If True, upgrade an existing virtual environment.
    :param with_pip: If True, ensure pip is installed in the virtual
                     environment
    :param prompt: Alternative terminal prefix for the environment.
    :param upgrade_deps: Update the base venv modules to the latest on PyPI
    FNc���||_||_||_||_||_||_|dkr0tj�t
j	����}||_
||_dS)N�.)�system_site_packages�clear�symlinks�upgrade�with_pip�orig_prompt�os�path�basename�getcwd�prompt�upgrade_deps)�selfr	r
rrr
rrs        �4/opt/alt/python311/lib64/python3.11/venv/__init__.py�__init__zEnvBuilder.__init__.si��%9��!���
� ��
���� ��
�!����S�=�=��W�%�%�b�i�k�k�2�2�F����(�����c���tj�|��}|�|��}|j}d|_|�|��|�|��|jr|�|��|j	s*|�
|��|�|��|rd|_|�|��|jr|�
|��dSdS)z�
        Create a virtual environment in a directory.

        :param env_dir: The target directory to create an environment in.

        FTN)rr�abspath�ensure_directoriesr	�create_configuration�setup_pythonr
�
_setup_pipr�
setup_scripts�
post_setupr�upgrade_dependencies)r�env_dir�context�true_system_site_packagess    r�createzEnvBuilder.create<s���'�/�/�'�*�*���)�)�'�2�2��%)�$=�!�$)��!��!�!�'�*�*�*����'�"�"�"��=�	%��O�O�G�$�$�$��|�	%����w�'�'�'��O�O�G�$�$�$�$�	/�)-�D�%��%�%�g�.�.�.���	/��%�%�g�.�.�.�.�.�	/�	/rc��tj|��D]�}tj�||��}tj�|��stj�|��rtj|���utj�|��rtj	|����dS�N)
r�listdirr�join�islink�isfile�remove�isdir�shutil�rmtree)rr�fns   r�clear_directoryzEnvBuilder.clear_directoryXs����*�T�"�"�	"�	"�B�����d�B�'�'�B��w�~�~�b�!�!�
"�R�W�^�^�B�%7�%7�
"��	�"�
�
�
�
�����r�"�"�
"��
�b�!�!�!��	"�	"rc�>�||||d�}tj|d|���S)N)�base�platbase�installed_base�installed_platbase�venv)�scheme�vars)�	sysconfig�get_path)rr"�namer9s    r�
_venv_pathzEnvBuilder._venv_path`s4����%�")�	
�
���!�$�v�D�A�A�A�Arc��d�}tjtj|��vr td|�dtj�d����tj�|��r|jr|�|��tj	��}||_
tj�|��d|_|j
�|j
n|j}d|z|_
||��tj}|std���tj�tj�|����\}}||_||_||_|�|d	��}|�|d
��}	|�|d��}
|	|_||	��||
��tjdkrttjd
krdtjdkrTtj�|d��}tj�|��stjd|��||_tj�||��|_tj�||��|_||��|j|_tjdkr�tj� |j��}tj�!|��tj�!|j��kr(tD�#d|j|��||_|S)z�
        Create the directories for the environment.

        Returns a context object which holds paths in the environment,
        for use by subsequent logic.
        c��tj�|��stj|��dStj�|��stj�|��rt
d|z���dS)NzUnable to create directory %r)rr�exists�makedirsr*r+�
ValueError)�ds r�create_if_neededz7EnvBuilder.ensure_directories.<locals>.create_if_neededqsw���7�>�>�!�$�$�
F���A�����������"�"�
F�b�g�n�n�Q�&7�&7�
F� �!@�1�!D�E�E�E�
F�
FrzRefusing to create a venv in z( because it contains the PATH separator r�Nz(%s) z�Unable to determine path to the running Python interpreter. Provide an explicit path or check that your PATH environment variable is correctly set.�scripts�include�purelibl�posix�darwin�lib64�lib�win32z�Actual environment location may have moved due to redirects, links or junctions.
  Requested location: "%s"
  Actual location:    "%s")$r�pathsep�fspathrBrr@r
r1�types�SimpleNamespacer"�split�env_namer�sys�_base_executabler�
executable�
python_dir�
python_exer=�inc_path�maxsizer<�platformr)�symlink�bin_path�relpath�bin_name�env_exe�env_exec_cmd�realpath�normcase�logger�warning)
rr"rDr#rrV�dirname�exename�binpath�incpath�libpath�	link_path�real_env_exes
             rrzEnvBuilder.ensure_directoriesis	��	F�	F�	F��:���7�+�+�+�+��M�W�M�M�?A�z�M�M�M�N�N�
N�
�7�>�>�'�"�"�	*�t�z�	*�� � ��)�)�)��'�)�)��!����7�=�=��1�1�!�4��� $�� 7����W�=M�� �6�)������!�!�!��)�
��	/��.�/�/�
/��7�=�=������)D�)D�E�E����'���$���$����/�/�'�9�5�5���/�/�'�9�5�5���/�/�'�9�5�5��"������!�!�!����!�!�!�
�[�5�
 �
 �r�w�'�'9�'9�
�\�X�
%�
%�����W�g�6�6�I��7�>�>�)�,�,�
-��
�5�)�,�,�,�"����7�?�?�7�G�<�<����'�,�,�w��8�8������!�!�!� '�����<�7�"�"��7�+�+�G�O�<�<�L��w����-�-���1A�1A�'�/�1R�1R�R�R���� <� '���	>�>�>�
(4��$��rc��tj�|jd��x|_}t|dd���5}|�d|jz��|jrd}nd}|�d|z��|�d	tj
d
d�z��|j�|�d|j�d
���|�dtj�tj
��z��g}tjdk}|r|jr|�d��|s|js|�d��|js|�d��|jr|�d��|jr|�d��|jr|�d��|jr|�d��|j�|�d|j�d���|�|j��d�|��}|�dtj
�d|�d
���d
d
d
��d
S#1swxYwYd
S)aA
        Create a configuration file indicating where the environment's Python
        was copied from, and whether the system site-packages should be made
        available in the environment.

        :param context: The information for the environment creation request
                        being processed.
        z
pyvenv.cfg�w�utf-8)�encodingz
home = %s
�true�falsez"include-system-site-packages = %s
zversion = %d.%d.%d
N�z	prompt = �
zexecutable = %s
�nt�
--symlinks�--copies�
--without-pip�--system-site-packages�--clear�	--upgrade�--upgrade-depsz
--prompt="�"� z
command = z	 -m venv )rrr)r"�cfg_path�open�writerWr	rT�version_inforrbrVr<r�appendr
r
rrr)rr#r�f�incl�argsrus       rrzEnvBuilder.create_configuration�s���#%�'�,�,�w���"M�"M�M���4�
�$��g�
.�
.�
.� 	D�!�
�G�G�M�G�$6�6�7�7�7��(�
������
�G�G�9�D�@�A�A�A�
�G�G�*�S�-=�b�q�b�-A�A�B�B�B��{�&����5�D�K�5�5�5�6�6�6�
�G�G�'�"�'�*:�*:�3�>�*J�*J�J�K�K�K��D���D��B��
*�d�m�
*����L�)�)�)��
(�d�m�
(����J�'�'�'��=�
-����O�,�,�,��(�
6����4�5�5�5��z�
'����I�&�&�&��|�
)����K�(�(�(�� �
.����,�-�-�-���+����<��)9�<�<�<�=�=�=��K�K���(�(�(��8�8�D�>�>�D�
�G�G�B���B�B�$�B�B�B�C�C�C�A 	D� 	D� 	D� 	D� 	D� 	D� 	D� 	D� 	D� 	D� 	D� 	D���� 	D� 	D� 	D� 	D� 	D� 	Ds�H$I0�0I4�7I4ruc��|j}|s�	tj�|��s�|rutj�|��tj�|��ksJ�tjtj�|��|��ntj||��n.#t$r!t�	d||��d}YnwxYw|rtj||��dSdS)�Y
            Try symlinking a file, and if that fails, fall back to copying.
            �Unable to symlink %r to %rTN)rrrr*rfr\r�	Exceptionrdrer.�copyfile)r�src�dst�relative_symlinks_ok�
force_copys     r�symlink_or_copyzEnvBuilder.symlink_or_copy�s��"�]�*�J��

&�	&��7�>�>�#�.�.�1�/�1�#%�7�?�?�3�#7�#7�2�7�?�?�3�;O�;O�#O�#O�#O�#O��J�r�w�'7�'7��'<�'<�c�B�B�B�B��J�s�C�0�0�0��� �&�&�&��N�N�#?��c�J�J�J�!%�J�J�J�&�����
*����S�)�)�)�)�)�
*�
*s�B+B8�8(C#�"C#c�P�tj�|��otj�|��}|jr�|s�tj�|��s�	|rutj�|��tj�|��ksJ�tjtj�|��|��ntj||��dS#t$rt�d||��YnwxYwtj�tj�|����\}}tj�
tj�t��dd||z��}tj��stj�|��sv|�d��rd|z}|dd�}|dkrd}n|d	krd
}tj�
tj�|��||z��}n|}tj�|��s|st�d|��dSt'j||��dS)r�Nr�rFru�_d����python�venvlauncher�pythonw�
venvwlauncherzUnable to copy %r)rr�lexistsr@rr*rfr\rr�rdre�splitextr)�__file__r:�is_python_buildr+�endswithr.r�)rr�r�r��bad_srcr�ext�srcfns        rr�zEnvBuilder.symlink_or_copy�sZ���g�o�o�c�*�*�F�2�7�>�>�#�3F�3F�/F�G��}�	
K�W�	
K�R�W�^�^�C�5H�5H�	
K�K�+�-�!�w���s�3�3�r�w���s�7K�7K�K�K�K�K��
�2�7�#3�#3�C�#8�#8�#�>�>�>�>��
�3��,�,�,��F�� �K�K�K��N�N�#?��c�J�J�J�J�J�K����
�G�,�,�R�W�-=�-=�c�-B�-B�C�C�M�H�c��G�L�L������!:�!:�!*�!%�!)�C��1�1�E��(�*�*�

�"�'�.�.��2G�2G�

��$�$�T�*�*�-���*�C�'����}�H��x�'�'�-�H�H���*�*�.�H��g�l�l�2�7�?�?�3�#7�#7��C��H�H������7�>�>�#�&�&�
��=��N�N�#6��<�<�<����O�C��%�%�%�%�%s�)BC7�7&D �D c� �|j}|j}|j}|j}tjdkr�||j|��tj�|��st	j	|d��dddtjd��fD]�}tj�||��}tj�
|��sG||j|d���tj�|��st	j	|d����dS|jr>d	�t	j|��D��}t!j��rd
�|D��}n=hd�}tj�|j��}|�|��|D]k}tj�||��}	tj�|	��r*||	tj�||�����lt!j��r�t	j|j��D]�\}
}}d|vr�tj�|
��}
tj�|jd
|
��}
tj�
|
��st	j|
��tj�|
d��}	tj�|
d��}t1j|	|��dS��dSdS)z�
        Set up a Python executable in the environment.

        :param context: The information for the environment creation request
                        being processed.
        rui�r��python3zpython3.rET)r�c��g|]H}tj�tj�|��d��dv�F|��IS)rE)�.exez.dll)rrrcr���.0r�s  r�
<listcomp>z+EnvBuilder.setup_python.<locals>.<listcomp>5sS�������G�$�$�R�W�%5�%5�a�%8�%8��%;�<�<�@P�P�P��P�P�Prc�v�g|]6}tj�|���d���4|��7S))r��	vcruntime)rrrc�
startswithr�s  rr�z+EnvBuilder.setup_python.<locals>.<listcomp>:sM�� � � ����(�(��+�+�6�6�7N�O�O� �� � � r>�
python.exe�pythonw.exe�python_d.exe�
pythonw_d.exezinit.tcl�LibN)r]r`r�rWrr<rVrr*�chmodrTr�r)r@rr(r:r�r�addr��walkr"rAr.r�)rr#rhr�copierrf�suffix�suffixes�base_exer��root�dirs�files�tcldirr�s               rrzEnvBuilder.setup_pythons����"������%���$��
�7�d�?�?��F�7�%�t�,�,�,��7�>�>�$�'�'�
&����u�%�%�%�#�Y�0P�3�;K�A�;N�0P�0P�Q�
.�
.���w�|�|�G�V�4�4���w�~�~�d�+�+�.��F�7�?�D�t�L�L�L�L��7�>�>�$�/�/�.����u�-�-�-��
.�
.��}�
'�
��!�z�'�2�2������,�.�.�� � �#+� � � �H��
Z�Y�Y���7�+�+�G�O�<�<�����X�&�&�&�"�
?�
?���g�l�l�7�F�3�3���7�?�?�3�'�'�?��F�3�����W�f� =� =�>�>�>���(�*�*�
�)+���1C�)D�)D�	�	�%�D�$��!�U�*�*�!#��!1�!1�$�!7�!7��!#����g�o�u�f�!M�!M��!�w�~�~�f�5�5�0��K��/�/�/� �g�l�l�4��<�<�� �g�l�l�6�:�>�>�����S�1�1�1����+�
�
�	�	rc��|jg|�}tj���x|d<}|j|d<|�dd��|�dd��|j|d<|j|d<t
j|fi|��dS)z8Executes the newly created Python using safe-ish options�env�VIRTUAL_ENV�
PYTHONHOMEN�
PYTHONPATH�cwdrV)rar�environ�copyr"�pop�
subprocess�check_output)rr#�py_args�kwargsr�r�s      r�_call_new_pythonzEnvBuilder._call_new_pythonUs����$�/�w�/�� �j�o�o�/�/�/��u�
��$�_��M������d�#�#�#�����d�#�#�#����u�
�&�3��|�����/�/��/�/�/�/�/rc�P�|�|ddddtj���dS)z1Installs or upgrades pip in a virtual environment�-m�	ensurepipr{z
--default-pip)�stderrN)r�r��STDOUT�rr#s  rrzEnvBuilder._setup_pipds>�����g�t�[�+�-�j�6G�	�	I�	I�	I�	I�	Irc���tj�tj�t����}tj�|d��}|�||��dS)a�
        Set up scripts into the created environment from a directory.

        This method installs the default scripts into the environment
        being created. You can prevent the default installation by overriding
        this method if you really need to, or if you need to specify
        a different location for the scripts to install. By default, the
        'scripts' directory in the venv package is used as the source of
        scripts to install.
        rFN)rrrrfr�r)�install_scripts)rr#rs   rrzEnvBuilder.setup_scriptsisV���w���r�w���x�8�8�9�9���w�|�|�D�)�,�,�����W�d�+�+�+�+�+rc��dS)a
        Hook for post-setup modification of the venv. Subclasses may install
        additional packages or scripts here, add activation shell scripts, etc.

        :param context: The information for the environment creation request
                        being processed.
        N�r�s  rr zEnvBuilder.post_setupxs	��	
�rc��|�d|j��}|�d|j��}|�d|j��}|�d|j��}|�d|j��}|S)ai
        Replace variable placeholders in script text with context-specific
        variables.

        Return the text passed in , but with variables replaced.

        :param text: The text in which to replace placeholder variables.
        :param context: The information for the environment creation request
                        being processed.
        �__VENV_DIR__�
__VENV_NAME__�__VENV_PROMPT__�__VENV_BIN_NAME__�__VENV_PYTHON__)�replacer"rSrr_r`)r�textr#s   r�replace_variableszEnvBuilder.replace_variables�sw���|�|�N�G�O�<�<���|�|�O�W�-=�>�>���|�|�-�w�~�>�>���|�|�/��1A�B�B���|�|�-�w��?�?���rc��|j}t|��}tj|��D�]\\}}}||kr3|dd�D]'}|dtjfvr|�|���(�@|D�]}	tjdkr+|	�d��r|	�d��r�>tj�	||	��}
||d��
tj��dd�}|s|}ntjj	|g|�R�}tj�|��stj
|��tj�	||	��}
t|
d��5}	|	���}ddd��n#1swxYwY|
�d��sw	|�d��}|�||��}|�d��}n5#t&$r(}d}t(�d	|
|��Yd}~nd}~wwxYw|�Rt|
d
��5}	|	�|��ddd��n#1swxYwYt/j|
|
������^dS)as
        Install scripts into the created environment from a directory.

        :param context: The information for the environment creation request
                        being processed.
        :param path:    Absolute pathname of a directory containing script.
                        Scripts in the 'common' subdirectory of this directory,
                        and those in the directory named for the platform
                        being run on, are installed in the created environment.
                        Placeholder variables are replaced with environment-
                        specific values.
        N�commonrur�)r�z.pdb��rbroz+unable to copy script %r, may be binary: %s�wb)r]�lenrr�r<r,r�r�rr)rR�sepr@rAr��read�decoder��encode�UnicodeErrorrdrer�r.�copymode)rr#rrh�plenr�r�r�rCr��srcfiler��dstdir�dstfile�data�es                rr�zEnvBuilder.install_scripts�s$���"���4�y�y��!#�����!	6�!	6��D�$���t�|�|��a�a�a��'�'�A���2�7� 3�3�3����A�������
6�
6���G�t�O�O����X�(>�(>�O��J�J�'7�8�8�$���'�,�,�t�Q�/�/���d�e�e��*�*�2�6�2�2�1�2�2�6���<�$�F�F��W�\�'�;�F�;�;�;�F��w�~�~�f�-�-�(��K��'�'�'��'�,�,�v�q�1�1���'�4�(�(�$�A��6�6�8�8�D�$�$�$�$�$�$�$�$�$�$�$����$�$�$�$��'�'�(8�9�9�H�H�#�{�{�7�3�3��#�5�5�d�G�D�D��#�{�{�7�3�3����'�H�H�H�#�����(;�<C�Q�H�H�H�H�H�H�H�H�����H�����#��g�t�,�,�&������
�
�
�&�&�&�&�&�&�&�&�&�&�&����&�&�&�&��O�G�W�5�5�5��7
6�
!	6�!	6s=�9F�F�!F�;AG<�<
H.�H)�)H.�I%�%I)�,I)c��t�dt�d|j����|j|ddddgt�R�dS)Nz
Upgrading z
 packages in r�r�installr{)rd�debug�CORE_VENV_DEPSr]r�r�s  rr!zEnvBuilder.upgrade_dependencies�sh�����H��H�H�g�6F�H�H�	
�	
�	
�	���g�t�U�I�{�	/�-�	/�	/�	/�	/�	/�	/r)FFFFFNF)F)�__name__�
__module__�__qualname__�__doc__rr%r1r=rrrr<r�rr�rrr r�r�r!r�rrrrsK��������2:?�GK�#�)�)�)�)�/�/�/�8"�"�"�B�B�B�B�B�B�H*D�*D�*D�X
�w�$���	*�	*�	*�	*�	*�&)	&�)	&�)	&�)	&�V;�;�;�z
0�
0�
0�I�I�I�

,�
,�
,�
�
�
����$06�06�06�d/�/�/�/�/rrFc�Z�t||||||���}|�|��dS)z,Create a virtual environment in a directory.)r	r
rr
rrN)rr%)r"r	r
rr
rr�builders        rr%r%�sD���.B�$�x�(� &�\�C�C�C�G��N�N�7�����rc�L�d}tjdkrd}nttd��sd}|std���ddl}|�tdd�	��}|�d
ddd
���|�ddddd���tj	dkrd}nd}|�
��}|�d|ddd���|�d|ddd���|�ddddd���|�ddddd ���|�d!d"ddd#�$��|�d%d&�'��|�d(ddd)d*�d+�t�������|�|��}|jr|jrtd,���t#|j|j|j|j|j|j|j�-��}|jD]}|�|���dS).NT)rsrsF�base_prefixz.This script is only for use with Python >= 3.3rzFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)�prog�description�epilogr��ENV_DIR�+z)A directory to create the environment in.)�metavar�nargs�helpry�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destrrurvrz[Try to use symlinks rather than copies, when symlinks are not the default for the platform.rw�store_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.rzr
zcDelete the contents of the environment directory if it already exists, before environment creation.r{rzlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.rxr
z]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))rrrrz--promptz;Provides an alternative prompt prefix for this environment.)rr|rz;Upgrade core dependencies: {} to the latest version in PyPIr~z1you cannot supply --upgrade and --clear together.)r	r
rrr
rr)rTr��hasattrrB�argparse�ArgumentParserr��add_argumentrr<�add_mutually_exclusive_group�formatr)r��
parse_argsrr
rrrr
rrr�r%)	r��
compatibler�parser�use_symlinks�group�optionsr�rCs	         r�mainr�s���J�
��&� � ��
�
�
�S�-�
(�
(���
��F��I�J�J�J������(�(�h�6D�1H�)�	I�	I��	���F�I�S�!L�	�	N�	N�	N����4�e�#/�m�"=�	�	>�	>�	>��7�d�?�?� �L�L��L��3�3�5�5��
���<��".�Z�!0�	�	1�	1�	1�
	���:�<�/?�"/�j�!0�	�	1�	1�	1�
	���I�u�\�!(�0G�	�	H�	H�	H�
	���K��|�!*�2M�	�	N�	N�	N�
	���O�*�$(��"/�	�	0�	0�	0�
	���J�"5�	�	6�	6�	6�	���,�e�L�!/�"3�39�6�!$���.�!9�!9�4;�4;�	�	<�	<�	<�
�#�#�D�)�)���?�	R�w�}�	R��P�Q�Q�Q��'�2E�#*�=�&-�&6�%,�_�&-�&6�$+�N�*1�*>�
@�@�@����	�	�A��N�N�1�����	�	r�__main__rEz	Error: %s)�file)FFFFNFr')r��loggingrr.r�rTr:rPr��	getLoggerr�rdrr%r�rcr�r��printr��exitr�rr�<module>rsb��������	�	�	�	�
�
�
�
�����
�
�
�
���������'��	��	�8�	$�	$��w/�w/�w/�w/�w/�w/�w/�w/�t
7<�EJ�����L�L�L�L�\�z���	
�B�0������
�����0�0�0�
��k�A�o�C�J�/�/�/�/�/�/�/�/�/�����0�����C�H�R�L�L�L�L�L��s�A�B�#A=�=B