Edit File: ve_lock.cpython-311.opt-1.pyc
� ����5/9e�����������������������������d�dl�mZ�d�dlZd�dlZd�dlmZ�dZej�����������������������������ed������������Z da da�G�d��de������������Z dd �Zd ��Zedd���������������ZdS�) �����)�absolute_importN)�contextmanagerz/etc/containerz.ve.cfg.lockFc�������������������������e�Zd�ZdS�)�LockFailedExceptionN)�__name__� __module__�__qualname__��������py/clveconfig/ve_lock.pyr���r������s���������������Dr���r���c����������������������t������������dS�|�rda �t����������t����������d������������a�t ����������j��������t����������������������������������������������t����������j���������������������n#�t����������$�r�t����������d�������������w�xY�wt������������ ��������������������dd�������������t�����������������������������������������������t��������������������������������t����������t����������j�����������������������������������������������t�����������������������������������������������dS�)NFTza+z$IO error happened while getting lockr���)�LOCK_FD� LOCK_WRITE�open� LOCK_FILE�fcntl�flock�fileno�LOCK_EX�IOErrorr����seek�truncate�write�str�os�getpid�flush�r���s��� r����setup_global_lockr������s�����������u����� �J��y�$�'�'�� ��G�N�N�$�$�e�m�4�4�4�4����J��J��J�!�"H�I�I�I�J�����L�L��A�����������M�M�#�b�i�k�k�"�"�#�#�#��M�M�O�O�O��4s����AA��A5c�������������������`�����t�����������rdS�t�����������t����������������������������������������������d�adS�d�S�)NFT)r���r����closer ���r���r����release_lockr"���.���s6�����������u���� � �������t���r���c��������������#����L���K����t����������|��������������dV���t�������������������������dS�)zQ Usage: with acquire_lock(): ... do something with ve.cfg ... N)r���r"���r���s��� r����acquire_lockr$���;���s,������������e���� �E�E�E��N�N�N�N�Nr���)F)� __future__r���r���r���� contextlibr���� CONFIG_DIR�path�joinr���r���r���� Exceptionr���r���r"���r$���r ���r���r����<module>r+������s�������'��&��&��&��&��&������� � � � ��%��%��%��%��%��%� � ��G�L�L��^�4�4� ���� � � �� �� �� �� �)�� �� �� ��������* �� �� ���������������r���