§
    dŠtjŠ  ã                  óô   — U d dl mZ d dlZd dlZd dlmZ d dlmZmZm	Z	 ddl
mZmZ ddlmZmZ ddlmZ d	Zd
ed<   dZded<   ed         Z G d„ de	¦  «        Z G d„ de¦  «        Zd d„Zd!d„Zd"d„Zg d¢ZdS )#é    )ÚannotationsN)Úsuppress)ÚFinalÚLiteralÚ
NamedTupleé   )Ú	host_nameÚprocess_start_token)ÚSoftFileLockÚ_read_lock_file)Ú	write_allz
filelock/2z
Final[str]Ú	_PROTOCOLiÿÿÿz
Final[int]Ú_MAX_PID)ÚleaseÚunknownc                  ó\   — e Zd ZU dZded<   ded<   ded<   dZd	ed
<   dZded<   dZded<   dS )ÚOwnerRecordz+The owner published in a protocol 2 marker.ÚintÚpidÚstrÚhostnameÚ	OwnerModeÚmodeNú
str | NoneÚtokenzfloat | NoneÚlease_durationú
int | NoneÚstart)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   © ó    úN/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/filelock/_marker.pyr   r      sf   € € € € € € Ø5Ð5à€H€H�HØ€M€M�MØ€O€O�OØ€EÐÐÐÑØ#'€NÐ'Ð'Ð'Ñ'Ø€EÐÐÐÑÐÐr%   r   c                  ó†   — e Zd ZU dZded<   edd„¦   «         Zedd„¦   «         Zedd
„¦   «         Zdd„Z	dd„Z
dd„Zdd„ZdS )ÚMarkerSoftFileLockzAAn existence lock whose marker carries a protocol 2 owner record.r   Ú_owner_modeÚreturnúOwnerRecord | Nonec                ó*   — |                       ¦   «         S )z­
        The owner named by the marker on disk.

        :returns: the published record, or ``None`` when no marker exists or its record is malformed or protocol 1

        )Ú_read_owner©Úselfs    r&   ÚownerzMarkerSoftFileLock.owner)   s   € ð ×ÒÑ!Ô!Ð!r%   r   c                ó@   — |                       ¦   «         x}€dn|j        S )z¬
        The PID of the process holding this lock, read from the marker.

        :returns: the PID, or ``None`` when no marker exists or its record is unreadable

        N)r-   r   ©r/   r0   s     r&   r   zMarkerSoftFileLock.pid3   s&   € ð "&×!1Ò!1Ñ!3Ô!3Ð3˜Ð<ˆtˆtÀ%Ä)ÐKr%   Úboolc                ó˜   — |                       ¦   «         }|duo2|j        t          j        ¦   «         k    o|j        t          ¦   «         k    S )z“
        Whether the marker on disk names this process.

        :returns: ``True`` when the marker's PID and hostname match this process

        N)r-   r   ÚosÚgetpidr   r	   r2   s     r&   Úis_lock_held_by_usz%MarkerSoftFileLock.is_lock_held_by_us=   sE   € ð × Ò Ñ"Ô"ˆØ˜DÐ Ð_ U¤Yµ"´)±+´+Ò%=Ð_À%Ä.ÕT]ÑT_ÔT_ÒB_Ð_r%   ÚNonec                ó.   — |                       ¦   «          dS )a-  
        Remove the marker whoever holds it, so a later contender can acquire.

        Forced breaking voids mutual exclusion: the previous holder keeps running and keeps using whatever the lock
        protects. Reserve it for an operator clearing a marker whose holder is known to be gone.
        N)Ú
break_lockr.   s    r&   Úforce_breakzMarkerSoftFileLock.force_breakH   s   € ð 	�ŠÑÔÐÐÐr%   c                ó¸   — t          t          t          ¦  «        5  t          t	          | j        ¦  «        d         ¦  «        cd d d ¦  «         S # 1 swxY w Y   d S )Nr   )r   ÚOSErrorÚ
ValueErrorÚparse_markerr   Ú	lock_filer.   s    r&   r-   zMarkerSoftFileLock._read_ownerQ   s�   € Ý•g�zÑ*Ô*ð 	Dð 	DÝ¥°´Ñ ?Ô ?ÀÔ BÑCÔCð	Dð 	Dð 	Dð 	Dñ 	Dô 	Dð 	Dð 	Dð 	Dð 	Dð 	Dð 	Døøøð 	Dð 	Dð 	Dð 	Dàˆts   ›'AÁAÁAÚfdr   c                ód   — t          |t          |                      ¦   «         ¦  «        ¦  «         d S )N)r   Úencode_markerÚ_published_record)r/   rA   s     r&   Ú_write_lock_infoz#MarkerSoftFileLock._write_lock_infoV   s,   € Ý�"•m D×$:Ò$:Ñ$<Ô$<Ñ=Ô=Ñ>Ô>Ð>Ð>Ð>r%   r   c           	     ó¨   — t          t          j        ¦   «         t          ¦   «         | j        t          t          j        ¦   «         ¦  «        ¬¦  «        S )N)r   r   r   r   )r   r5   r6   r	   r)   r
   r.   s    r&   rD   z$MarkerSoftFileLock._published_recordY   s@   € ÝÝ”	‘”Ý‘[”[ØÔ!Ý%¥b¤i¡k¤kÑ2Ô2ð	
ñ 
ô 
ð 	
r%   N)r*   r+   )r*   r   )r*   r3   )r*   r8   )rA   r   r*   r8   )r*   r   )r   r    r!   r"   r#   Úpropertyr0   r   r7   r;   r-   rE   rD   r$   r%   r&   r(   r(   #   sà   € € € € € € ØKÐKð ÐÐÑàð"ð "ð "ñ „Xð"ð ðLð Lð Lñ „XðLð ð`ð `ð `ñ „Xð`ðð ð ð ðð ð ð ð
?ð ?ð ?ð ?ð
ð 
ð 
ð 
ð 
ð 
r%   r(   Úrecordr*   Úbytesc                ó‚  — t           d| j        › �d| j        › �d| j        › �g}| j        �|                     d| j        › �¦  «         | j        �|                     d| j        ›�¦  «         | j        �|                     d| j        › �¦  «         d                     d	„ |D ¦   «         ¦  «         	                    ¦   «         S )
z>Render an owner record as the bytes a protocol 2 marker holds.zpid=zhost=zmode=Nztoken=z	duration=zstart=Ú c              3  ó    K  — | ]	}|› d �V — Œ
dS )ú
Nr$   )Ú.0Úlines     r&   ú	<genexpr>z encode_marker.<locals>.<genexpr>k   s(   è è € Ð1Ð1 4�d�;�;�;Ð1Ð1Ð1Ð1Ð1Ð1r%   )
r   r   r   r   r   Úappendr   r   ÚjoinÚencode)rH   Úliness     r&   rC   rC   b   sÑ   € åÐ+˜vœzÐ+Ð+Ð-F°V´_Ð-FÐ-FÐH]ÐPVÔP[ÐH]ÐH]Ð^€EØ„|ÐØ�ŠÐ,˜fœlÐ,Ð,Ñ-Ô-Ð-ØÔÐ(Ø�ŠÐ: Ô!6Ð:Ð:Ñ;Ô;Ð;Ø„|ÐØ�ŠÐ,˜fœlÐ,Ð,Ñ-Ô-Ð-Ø�7Š7Ð1Ð1¨5Ð1Ñ1Ô1Ñ1Ô1×8Ò8Ñ:Ô:Ð:r%   Úcontentr   r+   c                óþ   — | r9|                       ¦   «                              ¦   «         x}r|d         t          k    rdS i }|dd…         D ]%}|                     d¦  «        \  }}}|s dS |||<   Œ&t	          |¦  «        S )zcReturn the owner a protocol 2 marker names, or ``None`` when the record is malformed or protocol 1.r   Nr   ú=)ÚstripÚ
splitlinesr   Ú	partitionÚ_build_record)rU   rT   ÚfieldsrO   ÚkeyÚ	separatorÚvalues          r&   r?   r?   n   sš   € àð  G§M¢M¡O¤O×$>Ò$>Ñ$@Ô$@Ð@˜5ð ÀUÈ1ÄXÕQZÒEZÐEZØˆtØ€FØ�a�b�b”	ð ð ˆØ $§¢¨sÑ 3Ô 3ÑˆˆY˜Øð 	Ø�4�4Øˆˆs‰ˆÝ˜Ñ Ô Ð r%   r\   údict[str, str]c                ó
  — |                       d¦  «        x}€d S |dk    rdnd}|                       d¦  «        }|rd| vrd S 	 t          | d         ¦  «        }d| v rt          | d         ¦  «        nd }d| v rt          | d         ¦  «        nd }n# t          $ r Y d S w xY wd|cxk    rt          k    sn d S |                       d	¦  «        }|dk    r |�|�t          j        |¦  «        r|d
k    sd S t          ||||||¬¦  «        S )Nr   r   r   Úhostr   Údurationr   r   r   r   )r   r   r   r   r   r   )Úgetr   Úfloatr>   r   ÚmathÚisfiniter   )r\   Ú	publishedr   r   r   rc   r   r   s           r&   r[   r[   {   s]  € ð
 —Z’Z Ñ'Ô'Ð'ˆ	Ð0ØˆtØ!*¨gÒ!5Ð!5�g�g¸9€DØ�zŠz˜&Ñ!Ô!€HØð �u FÐ*Ð*ØˆtðÝ�&˜”-Ñ Ô ˆØ0:¸fÐ0DÐ0D•5˜ 
Ô+Ñ,Ô,Ð,È$ˆØ(/°6Ð(9Ð(9•�F˜7”OÑ$Ô$Ð$¸tˆˆøÝð ð ð Øˆtˆtðøøøà�ÐÐÒÐ•xÒÐÐÐØˆtØ�JŠJ�wÑÔ€Eð ˆw‚€˜E˜M¨XÐ-=ÅdÄmÐT\ÑF]ÔF]Ð-=ÐbjÐmnÒbnÐbnØˆtÝ˜3¨¸ÀEÐZbÐjoÐpÑpÔpÐps   ÁAB Â
BÂB)r(   r   r   rC   r?   )rH   r   r*   rI   )rU   r   r*   r+   )r\   r`   r*   r+   )Ú
__future__r   rf   r5   Ú
contextlibr   Útypingr   r   r   Ú	_identityr	   r
   Ú_softr   r   Ú_utilr   r   r#   r   r   r   r(   rC   r?   r[   Ú__all__r$   r%   r&   ú<module>rp      sy  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø Ð Ð Ð Ð Ð ð
 %€	Ð $Ð $Ð $Ñ $à €Ð  Ð  Ð  Ñ  ð Ð&Ô'€	ðð ð ð ð �*ñ ô ð ð<
ð <
ð <
ð <
ð <
˜ñ <
ô <
ð <
ð~	;ð 	;ð 	;ð 	;ð
!ð 
!ð 
!ð 
!ðqð qð qð qð8ð ð €€€r%   