ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/virtualenv/util/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/virtualenv/util/__pycache__/lock.cpython-311.pyc

�

�܋f�����dZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZddl
mZmZGd�d	e��ZiZe��ZGd
�de���ZGd
�de��ZGd�de��Zgd�ZdS)z7holds locking functionality that works across processes�N)�ABCMeta�abstractmethod)�contextmanager)�Path)�Lock�RLock)�FileLock�Timeoutc�6��eZdZ�fd�Zd�fd�	Zd�fd�	Z�xZS)	�_CountedFileLockc�F��tj�|��}tj�|��s&	tj|��n#t
$rYnwxYwt
���|��d|_t��|_
dS�Nr)�os�path�dirname�isdir�makedirs�OSError�super�__init__�countr�thread_safe)�self�	lock_file�parent�	__class__s   ��e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/virtualenv/util/lock.pyrz_CountedFileLock.__init__s���������+�+���w�}�}�V�$�$�	�
���F�#�#�#�#���
�
�
���
����
������#�#�#���
� �7�7����s�A�
A#�"A#N皙�����?c����|j�|�dn|���st|j���|jdkr"t���||��|xjdz
c_dS)N���)�timeoutr�)r�acquirer
rrr)rr!�
poll_intervalrs   �rr#z_CountedFileLock.acquiresm�����'�'�g�o���7�'�S�S�	*��$�.�)�)�)��:��?�?��G�G�O�O�G�]�3�3�3��
�
�a��
�
�
�
�Fc�$��|j5|jdkr|j���|jdkr"t���|���t	|jdz
d��|_ddd��dS#1swxYwYdS)Nrr")�force)rr�releaser�max)rr'rs  �rr(z_CountedFileLock.release s����
�
�	0�	0��z�A�~�~�� �(�(�*�*�*��z�Q��������e��,�,�,��T�Z�!�^�Q�/�/�D�J�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0�	0�	0s�A/B�B	�B	)Nr�F)�__name__�
__module__�__qualname__rr#r(�
__classcell__�rs@rrr
st�������	#�	#�	#�	#�	#�������0�0�0�0�0�0�0�0�0�0r%rc��eZdZd�Zd�Zd�Zd�Zed���Zed���Z	ee
dd�����Zee
d	�����Zd
S)�PathLockBasec��t|��}|���r|���n||_dS�N)r�exists�resolver)r�folderrs   rrzPathLockBase.__init__.s1���F�|�|��&*�k�k�m�m�=�D�L�L�N�N�N���	�	�	r%c�0�|jj�d|j�d�S)N�(�))rr+r�rs r�__repr__zPathLockBase.__repr__2s ���.�)�8�8�D�I�8�8�8�8r%c�B�t|��|j|z��Sr3)�typer�r�others  r�__div__zPathLockBase.__div__5s���t�D�z�z�$�)�e�+�,�,�,r%c�,�|�|��Sr3)r@r>s  r�__truediv__zPathLockBase.__truediv__8s���|�|�E�"�"�"r%c��t�r3��NotImplementedErrorr:s r�	__enter__zPathLockBase.__enter__;���!�!r%c��t�r3rD�r�exc_type�exc_val�exc_tbs    r�__exit__zPathLockBase.__exit__?rGr%Fc��t�r3rD�r�name�no_blocks   r�lock_for_keyzPathLockBase.lock_for_keyC�
��"�!r%c��t�r3rD�rrPs  r�non_reentrant_lock_for_keyz'PathLockBase.non_reentrant_lock_for_keyHrSr%Nr*)
r+r,r-rr;r@rBrrFrMrrRrV�r%rr1r1-s�������>�>�>�9�9�9�-�-�-�#�#�#��"�"��^�"��"�"��^�"���"�"�"��^��^�"���"�"��^��^�"�"�"r%r1)�	metaclassc���eZdZ�fd�Zd
d�Zed���Zd�Zd�Zd�Z	dd	�Z
ed
���Zedd���Z
ed���Z�xZS)�ReentrantFileLockc�X��t���|��d|_dSr3)rr�_lock)rr6rs  �rrzReentrantFileLock.__init__Os&���
������ � � ���
�
�
r%�c���t|j|�d�z��}t5|tvrt	|��t|<t|cddd��S#1swxYwYdS�Nz.lock)�strr�_store_lock�_lock_storer)rrPrs   r�_create_lockzReentrantFileLock._create_lockSs�����	�t�N�N�N�2�3�3�	�
�	*�	*���+�+�)9�)�)D�)D��I�&��y�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s�-A�A �#A c���|�lt5|j5|jdkr t�|jd��ddd��n#1swxYwYddd��dS#1swxYwYdSdSr)rarrrb�popr��locks r�	_del_lockzReentrantFileLock._del_lockZs������
>�
>��%�>�>��z�Q���#������=�=�=�>�>�>�>�>�>�>�>�>�>�>����>�>�>�>�
>�
>�
>�
>�
>�
>�
>�
>�
>�
>�
>�
>����
>�
>�
>�
>�
>�
>��s3�A"�,A
�A"�
A	�A"�A	�A"�"A&�)A&c�:�|�|j��dSr3)rhr\r:s r�__del__zReentrantFileLock.__del__bs�����t�z�"�"�"�"�"r%c�l�|���|_|�|j��dSr3)rcr\�
_lock_filer:s rrFzReentrantFileLock.__enter__es/���&�&�(�(��
�����
�#�#�#�#�#r%c�|�|�|j��|�|j��d|_dSr3)�_releaser\rhrIs    rrMzReentrantFileLock.__exit__is5���
�
�d�j�!�!�!����t�z�"�"�"���
�
�
r%Fc�N�	tjt|j����n#t$rYnwxYw	|�d��dS#t$rI|r�tjd|j	��|�
��|���YdSwxYw)Ng-C��6?z/lock file %s present, will block until released)rrr`rrr#r
�logging�debugrr()rrgrQs   rrlzReentrantFileLock._lock_filens���	��K��D�I���'�'�'�'���	�	�	��D�	����	��L�L�� � � � � ���	�	�	��
���M�K�T�^�\�\�\��L�L�N�N�N��L�L�N�N�N�N�N�N�	���s�&)�
6�6�A�AB$�#B$c�.�|���dSr3)r(rfs rrnzReentrantFileLock._releases���������r%c#�4K�|�|��}		|�||��dV�|�|��n#|�|��wxYw	|�|��d}dS#|�|��d}wxYwr3)rcrlrnrh)rrPrQrgs    rrRzReentrantFileLock.lock_for_key�s������ � ��&�&��	�
$�����h�/�/�/������
�
�d�#�#�#�#���
�
�d�#�#�#�#����#��N�N�4� � � ��D�D�D��
�N�N�4� � � ��D�K�K�K�Ks�A
�A>�
A!�!A>�>Bc#�K�tt|j|�d�z����5dV�ddd��dS#1swxYwYdSr_)rr`rrUs  rrVz,ReentrantFileLock.non_reentrant_lock_for_key�s�����
�c�$�)��n�n�n�"<�=�=�
>�
>�	�	��E�E�E�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�<�A�A)r]r*)r+r,r-rrc�staticmethodrhrjrFrMrlrnrrRrVr.r/s@rrZrZNs�������������*�*�*�*��>�>��\�>�#�#�#�$�$�$����
����"����\���
�
�
��^�
�����^�����r%rZc�H�eZdZd�Zd�Zedd���Zed���ZdS)�NoOpFileLockc��t�r3rDr:s rrFzNoOpFileLock.__enter__����!�!r%c��t�r3rDrIs    rrMzNoOpFileLock.__exit__�ryr%Fc#�K�dV�dSr3rWrOs   rrRzNoOpFileLock.lock_for_key������
�����r%c#�K�dV�dSr3rWrUs  rrVz'NoOpFileLock.non_reentrant_lock_for_key�r|r%Nr*)r+r,r-rFrMrrRrVrWr%rrwrw�sm������"�"�"�"�"�"������^������^���r%rw)rwrZr
)�__doc__rpr�abcrr�
contextlibr�pathlibr�	threadingrr�filelockr	r
rrbrar1rZrw�__all__rWr%r�<module>r�sg��=�=�����	�	�	�	�'�'�'�'�'�'�'�'�%�%�%�%�%�%�������!�!�!�!�!�!�!�!�&�&�&�&�&�&�&�&�0�0�0�0�0�x�0�0�0�8���d�f�f��"�"�"�"�"�W�"�"�"�"�BE�E�E�E�E��E�E�E�P
�
�
�
�
�<�
�
�
� �����r%

Zerion Mini Shell 1.0