관리-도구
편집 파일: linklockfile.cpython-311.pyc
� ������9�����������������������^�����d�dl�mZ�d�dlZd�dlZddlmZmZmZmZm Z m Z ��G�d��de������������ZdS�)�����)�absolute_importN����)�LockBase� LockFailed� NotLocked� NotMyLock�LockTimeout� AlreadyLockedc��������������������2�����e�Zd�ZdZdd�Zd��Zd��Zd��Zd��ZdS�) �LinkLockFilez�Lock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = LinkLockFile('somefile', threaded=False) Nc���������������������� �t����������|�j��������d������������������������������������������������n%#�t����������$�r�t ����������d|�j��������z���������������w�xY�w|�|n|�j��������}t ����������j����������������������}|�|dk����r||z ��} � �t����������j��������|�j��������|�j ���������������������d�S�#�t����������$�r��t����������j��������|�j��������������������j��������}|dk����rY�d�S�|�dt ����������j����������������������|k����rMt����������j ��������|�j���������������������|dk����rt����������d|�j��������z���������������t!����������d|�j��������z���������������t ����������j��������|d�ur|dz��pd �������������Y�nw�xY�w��) N�wbzfailed to create %sr���T����z&Timeout waiting to acquire lock for %sz%s is already locked� ���g�������?)�open�unique_name�close�IOErrorr����timeout�time�os�link� lock_file�OSError�stat�st_nlink�unlinkr ����pathr ����sleep)�selfr����end_time�nlinkss��� �u/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/lockfile/linklockfile.py�acquirezLinkLockFile.acquire���s������ G���!�4�(�(�.�.�0�0�0�0���� G�� G�� G��2�T�5E�E�F�F�F� G�����%�0�'�'�d�l���9�;�;����7�Q�;�;����H� � ����(�$�.�9�9�9�,����+��� L�� L�� L����!1�2�2�;���Q�;�;���F�F���*�t�y�{�{�X�/E�/E�� �$�"2�3�3�3�"�Q�;�;�"-��/=�.2�i�/8��#9��#9��9��#0�0F�04� �1:��#;��#;��;��J�w�d�2�C�w��|�J�s�K�K�K�K�K�% L���� s"����'*��"A�<B��.E�BE�Ec������������������6����|�������������������������������������st����������d|�j��������z���������������t����������j�����������������������������|�j��������������������st ����������d|�j��������z���������������t����������j��������|�j���������������������t����������j��������|�j���������������������d�S�)Nz%s is not lockedz%s is locked, but not by me) � is_lockedr���r���r����existsr���r���r���r����r ���s��� r#����releasezLinkLockFile.release7���s��������~�~���� G��.���:�;�;�;������ 0�1�1�� G��9�D�I�E�F�F�F� � �$�"�#�#�#� � �$�.�!�!�!�!�!�����c������������������J�����t�����������j�����������������������������|�j��������������������S��N)r���r���r'���r���r(���s��� r#���r&���zLinkLockFile.is_locked?���s�������w�~�~�d�n�-�-�-r*���c�����������������������|�������������������������������������oEt����������j�����������������������������|�j��������������������o!t����������j��������|�j��������������������j��������dk����S�)Nr���)r&���r���r���r'���r���r���r���r(���s��� r#����i_am_lockingzLinkLockFile.i_am_lockingB���sJ��������� � ��8�����t�/�0�0�8����(�)�)�2�a�7� 9r*���c�����������������������t�����������j�����������������������������|�j��������������������rt����������j��������|�j���������������������d�S�d�S�r,���)r���r���r'���r���r���r(���s��� r#���� break_lockzLinkLockFile.break_lockG���s<������ �7�>�>�$�.�)�)�� &��I�d�n�%�%�%�%�%� &�� &r*���r,���) �__name__� __module__�__qualname__�__doc__r$���r)���r&���r.���r0�����r*���r#���r���r��� ���so�����������������$��$��$��$�L"��"��"�.��.��.�9��9��9� &��&��&��&��&r*���r���)� __future__r���r���r�����r���r���r���r���r ���r ���r���r5���r*���r#����<module>r8������s�������&��&��&��&��&��&������� � � � ��������������������������������?&��?&��?&��?&��?&�8��?&��?&��?&��?&��?&r*���