%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/venv/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/venv/__pycache__/__init__.cpython-312.pyc

�

���f�b��*�dZddlZddlZddlZddlZddlZddlZddlZdZeje
�ZGd�d�Z		dd�Z
d
d�Ze
dk(rd	Z	e�dZej(e�yy#e$r!Zed
ezej&��YdZ[�5dZ[wwxYw)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)�pipc��eZdZdZ			dd�Zd�Zd�Zd�Zd�Zd�Z	e
jd	k7rdd
�Zndd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�
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
    Nc���||_||_||_||_||_||_|dk(r1tjjt
j��}||_
||_y)N�.)�system_site_packages�clear�symlinks�upgrade�with_pip�orig_prompt�os�path�basename�getcwd�prompt�upgrade_deps)�selfrr	r
rrrrs        �$/usr/lib/python3.12/venv/__init__.py�__init__zEnvBuilder.__init__.s`��%9��!���
� ��
���� ��
�!����S�=��W�W�%�%�b�i�i�k�2�F����(���c���tjj|�}|j|�}|j}d|_|j|�|j
|�|jr|j|�|js"|j|�|j|�|rd|_|j|�|jr|j|�yy)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��%)�$=�$=�!�$)��!��!�!�'�*����'�"��=�=��O�O�G�$��|�|����w�'��O�O�G�$�$�)-�D�%��%�%�g�.�����%�%�g�.�rc��tj|�D]�}tjj||�}tjj	|�stjj|�rtj|��wtjj|�s��tj|���y�N)
r�listdirr�join�islink�isfile�remove�isdir�shutil�rmtree)rr�fns   r�clear_directoryzEnvBuilder.clear_directoryXst���*�*�T�"�	"�B������d�B�'�B��w�w�~�~�b�!�R�W�W�^�^�B�%7��	�	�"�
������r�"��
�
�b�!�	"rc�@�||||d�}tj|d|��S)N)�base�platbase�installed_base�installed_platbase�venv)�scheme�vars)�	sysconfig�get_path)rr!�namer8s    r�
_venv_pathzEnvBuilder._venv_path`s,����%�")�	
���!�!�$�v�D�A�Arc���d�}tjtj|�vr td|�dtj�d���tjj|�r|jr|j|�tj�}||_
tjj|�d|_|j�|jn|j}d|z|_
||�tj}|std��tjjtjj!|��\}}||_||_||_|j)|d�}|j)|d	�}	|j)|d
�}
|	|_||	�|
|_||
�tj.dkDr{tj0dk(rhtj2d
k7rUtjj5|d�}tjj|�stj6d|�||_tjj;||�|_tjj5||�|_||�|j>|_ tj2dk(r�tjjC|j>�}tjjE|�tjjE|j>�k7r(tFjId|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��tjj|�stj|�ytjj	|�stjj|�rt
d|z��y)NzUnable to create directory %r)rr�exists�makedirsr)r*�
ValueError)�ds r�create_if_neededz7EnvBuilder.ensure_directories.<locals>.create_if_neededqsR���7�7�>�>�!�$����A��������"�b�g�g�n�n�Q�&7� �!@�1�!D�E�E�'8rzRefusing to create a venv in z( because it contains the PATH separator r�z(%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�fspathrArr?r	r0�types�SimpleNamespacer!�split�env_namer�sys�_base_executabler�
executable�
python_dir�
python_exer<�inc_path�lib_path�maxsizer;�platformr(�symlink�bin_path�relpath�bin_name�env_exe�env_exec_cmd�realpath�normcase�logger�warning)
rr!rCr"rrU�dirname�exename�binpath�incpath�libpath�	link_path�real_env_exes
             rrzEnvBuilder.ensure_directoriesis���	F��:�:����7�+�+��<�W�I�F?�?A�z�z�l�!�M�N�
N�
�7�7�>�>�'�"�t�z�z�� � ��)��'�'�)��!����7�7�=�=��1�!�4��� $��� 7����W�=M�=M�� �6�)�����!��)�)�
���.�/�
/��7�7�=�=�������)D�E����'���$���$����/�/�'�9�5���/�/�'�9�5���/�/�'�9�5��"�����!�"�����!�
�[�[�5�
 �r�w�w�'�'9�
�\�\�X�
%������W�g�6�I��7�7�>�>�)�,��
�
�5�)�,�"����7�7�?�?�7�G�<����'�'�,�,�w��8�����!� '������<�<�7�"��7�7�+�+�G�O�O�<�L��w�w����-����1A�1A�'�/�/�1R�R���� <� '����	>�
(4��$��rc��tjj|jd�x|_}t|dd��5}|j
d|jz�|jrd}nd}|j
d|z�|j
d	tjd
dz�|j�|j
d|j�d
��|j
dtjjtj�z�g}tjdk(}|r|jr|j!d�|s|js|j!d�|j"s|j!d�|jr|j!d�|j$r|j!d�|j&r|j!d�|j(r|j!d�|j*�|j!d|j*�d��|j!|j�dj|�}|j
dtj�d|�d
��d
d
d
�y
#1swYy
xYw)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�writerVrrS�version_inforrbrUr;r
�appendrr	rrr
)rr"r�f�incl�argsrus       rrzEnvBuilder.create_configuration�s���#%�'�'�,�,�w����"M�M���4�
�$��g�
.� 	D�!�
�G�G�M�G�$6�$6�6�7��(�(�����
�G�G�9�D�@�A�
�G�G�*�S�-=�-=�b�q�-A�A�B��{�{�&����)�D�K�K�?�"�5�6�
�G�G�'�"�'�'�*:�*:�3�>�>�*J�J�K��D����D��B��d�m�m����L�)��d�m�m����J�'��=�=����O�,��(�(����4�5��z�z����I�&��|�|����K�(�� � ����,�-����+����j��)9�)9�(:�!�<�=��K�K����(��8�8�D�>�D�
�G�G�j���� 0�	�$��r�B�C�A 	D� 	D� 	D�s
�H4I=�=Jruc��|j}|s�	tjj|�s�|rutjj	|�tjj	|�k(sJ�tj
tjj
|�|�ntj
||�|rtj||�yy#t$rtjd||�d}Y�>wxYw)�Y
            Try symlinking a file, and if that fails, fall back to copying.
            �Unable to symlink %r to %rTN)r
rrr)rfr\r�	Exceptionrdrer-�copyfile)r�src�dst�relative_symlinks_ok�
force_copys     r�symlink_or_copyzEnvBuilder.symlink_or_copy�s���"�]�]�*�J��	&��7�7�>�>�#�.�/�#%�7�7�?�?�3�#7�2�7�7�?�?�3�;O�#O�O�#O��J�J�r�w�w�'7�'7��'<�c�B��J�J�s�C�0������S�)���!�&��N�N�#?��c�J�!%�J�&�s�B,C�"C<�;C<c�2�tjj|�xr tjj|�}|jr�|s�tjj|�s�	|rutjj
|�tjj
|�k(sJ�tjtjj|�|�ytj||�ytjjtjj|��\}}tjjtjj
t�dd||z�}tj �stjj#|�sk|j%d�r
d|z}|dd}|dk(rd}n|d	k(rd
}tjjtjj
|�||z�}n|}tjj|�s|stjd|�yt'j(||�y#t$rtjd||�Y���wxYw)r�Nr�rEru�_d����python�venvlauncher�pythonw�
venvwlauncherzUnable to copy %r)rr�lexistsr?r
r)rfr\rr�rdre�splitextr(�__file__r9�is_python_buildr*�endswithr-r�)rr�r�r��bad_srcr�ext�srcfns        rr�zEnvBuilder.symlink_or_copy�s����g�g�o�o�c�*�F�2�7�7�>�>�#�3F�/F�G��}�}�W�R�W�W�^�^�C�5H�K�+�!�w�w���s�3�r�w�w���s�7K�K�K�K��
�
�2�7�7�#3�#3�C�#8�#�>���
�
�3��,���G�G�,�,�R�W�W�-=�-=�c�-B�C�M�H�c��G�G�L�L�������!:�!*�!%�!)�C��1�E��(�(�*�"�'�'�.�.��2G��$�$�T�*���*�C�'���}�H��x�'�-�H���*�.�H��g�g�l�l�2�7�7�?�?�3�#7��C��H�����7�7�>�>�#�&���N�N�#6��<���O�O�C��%��9!�K��N�N�#?��c�J�K�s�0A6I2�'I2�2 J�Jc��|j}|j}|j}|j}tj
dk7r�||j|�tjj|�st	j|d�dddtjd��fD]�}tjj||�}tjj|�r�C||j|d��tjj|�r�xt	j|d���y|jr�t	j|�D�cgc]E}tjj!tjj#|�d�d	vr|��G}}t%j&�r||D�cgc]2}tjj!|�j)d
�r|��4}}n>hd�}tjj+|j�}	|j-|	�|D]i}tjj||�}
tjj/|
�s�C||
tjj||���kt%j&��rt	j0|j�D]�\}}}
d|
vs�tjj+|�}tjj|j2d
|�}tjj|�st	j4|�tjj|d�}
tjj|d�}t7j8|
|�yyycc}wcc}w)z�
        Set up a Python executable in the environment.

        :param context: The information for the environment creation request
                        being processed.
        rui�r��python3zpython3.rDT)r�)�.exez.dll)r��	vcruntime>�
python.exe�pythonw.exe�python_d.exe�
pythonw_d.exezinit.tcl�LibN)r]r`r�rVrr;rUrr)�chmodrSr�r(r?r
r'rcr�r9r��
startswithr�addr��walkr!r@r-r�)rr"rhr�copierrf�suffixr��suffixes�base_exer��root�dirs�files�tcldirr�s                rrzEnvBuilder.setup_pythons����"�"�������%�%���$�$��
�7�7�d�?��7�%�%�t�,��7�7�>�>�$�'�����u�%�#�Y�(�3�;K�;K�A�;N�:O�0P�Q�
.���w�w�|�|�G�V�4���w�w�~�~�d�+��7�?�?�D�t�L��7�7�>�>�$�/�����u�-�
.��}�}� "�z�z�'�2����G�G�$�$�R�W�W�%5�%5�a�%8��%;�<�@P�P������,�,�.�#+� �����(�(��+�6�6�7N�O�� �H� �
Z���7�7�+�+�G�O�O�<�����X�&�"�
?���g�g�l�l�7�F�3���7�7�?�?�3�'��3������W�f� =�>�
?�
�(�(�*�)+����1C�1C�)D�	�%�D�$��!�U�*�!#���!1�!1�$�!7��!#�����g�o�o�u�f�!M��!�w�w�~�~�f�5��K�K��/� �g�g�l�l�4��<�� �g�g�l�l�6�:�>������S�1��	�+��'��
 s
�A
N<�=7Oc�6�|jg|�}tjj�x|d<}|j|d<|jdd�|jdd�|j|d<|j|d<t
j|fi|��y)z8Executes the newly created Python using safe-ish options�env�VIRTUAL_ENV�
PYTHONHOMEN�
PYTHONPATH�cwdrU)rar�environ�copyr!�pop�
subprocess�check_output)rr"�py_args�kwargsr�r�s      r�_call_new_pythonzEnvBuilder._call_new_pythonVs����$�$�/�w�/�� �j�j�o�o�/�/��u�
��$�_�_��M������d�#�����d�#�����u�
�&�3�3��|������/��/rc��	|j|ddddtj��y
#tj$r�}t	j
d�}tjj|�d��sLtdjt	j�|j��tjd	��d
}~wwxYw)z1Installs or upgrades pip in a virtual environment�-m�	ensurepipr{z
--default-pip)�stderr�stdlibz/ensurepip/__main__.pyanThe virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python{}-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: {}
rDN)r�r��STDOUT�CalledProcessErrorr9r:rrr?�print�format�get_python_versionrarS�exit)rr"�errr�s    rrzEnvBuilder._setup_pipes���	��!�!�'�4��k�"1�*�:K�:K�
"�
M���,�,�	��'�'��1�F��7�7�>�>�V�H�,B�"C�D����F�9�'�'�)�7�+?�+?�@�B��������!	�s�%(�C�BB?�?Cc���tjjtjjt��}tjj|d�}|j
||�y)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.
        rEN)rrrrfr�r(�install_scripts)rr"rs   rrzEnvBuilder.setup_scripts|sG���w�w���r�w�w���x�8�9���w�w�|�|�D�)�,�����W�d�+rc��y)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��rr"s  rrzEnvBuilder.post_setup�s��	
rc��|jd|j�}|jd|j�}|jd|j�}|jd|j�}|jd|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!rRrr_r`)r�textr"s   r�replace_variableszEnvBuilder.replace_variables�st���|�|�N�G�O�O�<���|�|�O�W�-=�-=�>���|�|�-�w�~�~�>���|�|�/��1A�1A�B���|�|�-�w���?���rc��|j}t|�}tj|�D�]�\}}}||k(r1|ddD](}|dtjfvs�|j|��*�>|D�]�}	tjdk(r#|	j
d�r|	jd�r�:tjj||	�}
||djtj�dd}|s|}n tjj|g|���}tjj|�stj|�tjj||	�}
t|
d�5}	|	j�}ddd�|
jd�s5	j!d�}|j#||�}|j%d�}���gt|
d
�5}	|	j-|�ddd�t/j0|
|
�������y#1swY��xYw#t&$r#}d}t(j+d	|
|�Yd}~�zd}~wwxYw#1swY�axYw)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(rQ�sepr?r@r��read�decoder��encode�UnicodeErrorrdrer�r-�copymode)rr"rrh�plenr�r�r�rBr��srcfiler��dstdir�dstfile�data�es                rr�zEnvBuilder.install_scripts�s���"�"���4�y��!#�����!	6��D�$���t�|��a��'�A���2�7�7� 3�3����A��'���
6���G�G�t�O����X�(>��J�J�'7�8���'�'�,�,�t�Q�/���d�e��*�*�2�6�6�2�1�2�6���$�F��W�W�\�\�'�;�F�;�F��w�w�~�~�f�-��K�K��'��'�'�,�,�v�q�1���'�4�(�$�A��6�6�8�D�$��'�'�(8�9�H�#�{�{�7�3��#�5�5�d�G�D��#�{�{�7�3��
�#��g�t�,�&������
�&��O�O�G�W�5�7
6�
!	6�&$�$��(�H�#�����(;�<C�Q�H�H��H��
&�&�s0�1H�4H#� I�H �#	I�,I
�
I�Ic��tjdt�d|j���|j|ddddgt���y)Nz
Upgrading z
 packages in r�r�installr{)rd�debug�CORE_VENV_DEPSr]r�r�s  rr zEnvBuilder.upgrade_dependencies�sJ�������(�
�g�6F�6F�5G�H�	
�	����g�t�U�I�{�	/�-�	/r)FFFFFNF)F)�__name__�
__module__�__qualname__�__doc__rr$r0r<rrrr;r�rr�rrrr�r�r r�rrrrsw���2:?�GK�#�)�/�8"�B�C�J*D�X
�w�w�$��	*�&)	&�V;�z
0��.
,�
��$06�d/rrc�H�t||||||��}|j|�y)z,Create a virtual environment in a directory.)rr	r
rrrN)rr$)r!rr	r
rrr�builders        rr$r$�s,���.B�$�x�(� &�\�C�G��N�N�7�rc
��ddl}|jtdd��}|jdddd�	�|jd
ddd
d��tj
dk(rd}nd}|j
�}|jd|ddd��|jd|ddd��|jddddd��|jddddd��|jddddd �!�|jd"d#�$�|jd%ddd&d'd(jt��d)���|j|�}|jr|jrtd*��t|j|j|j|j|j |j"|j$�+�}|j&D]}|j)|��y),NrzFCreates 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�helpryF�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destrruTrvr
z[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{rzlUpgrade 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|rzUpgrade core dependencies (z, z) to the latest version in PyPIz1you cannot supply --upgrade and --clear together.)rr	r
rrrr)�argparse�ArgumentParserr��add_argumentrr;�add_mutually_exclusive_groupr(r��
parse_argsrr	rArrr
rrrr�r$)r�r�parser�use_symlinks�group�optionsr�rBs        r�mainr�s(���
�
$�
$�(�2@�-D�%�	E�F�����	��H��J�
���0�%�+�-�9��:�
�w�w�$�������/�/�1�E�	���|�\�*��,��-�

���z�|�+;�+�*�,��-�
���	�5��$�,C��D�
����U�<�&�.K��L�
����j� $�]�+��,�
���
�1��2����(�%��+�:�4�9�9�^�;T�:U�V=�=��>�����%�G����7�=�=��L�M�M��g�.A�.A�&�}�}�")�"2�"2�!(���")�"2�"2� '���&-�&:�&:�
<�G��\�\������q��r�__main__rDz	Error: %s)�file)FFFFNFr&)r��loggingrr-r�rSr9rOr��	getLoggerr�rdrr$r�rcr�r�r�r�r�r�rr�<module>rs�����	�
��
�����	��	�	�8�	$��J/�J/�Z7<�EJ��C�L�z��	
�B�0���
��
�C�H�H�R�L���
�0�
�k�A�o�C�J�J�/�/��0�s�	A,�,B�1B
�
B

Zerion Mini Shell 1.0