+
    ‘°³j>  ã                  ó  € ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHtHt ^ RIHtHt ^RIHt ^R	IHt ^R
IHtHtHtHt ^RIHt ^RIHtH t  ]'       d/   ^ RI!t!^ RI"H#t# ^RI$H%t% ]!PL                  R8¼  d   ^ RIH't' M^ RI(H't' ]R,          t)]R ,          t*]! RR7       ! R R4      4       t+]! RR7       ! R R4      4       t,] ! R R4      4       t- ! R R4      t. ! R R].]4      t/ ! R R]4      t0. R!Ot1R# )"é    )ÚannotationsN)Úsuppress)Ú	dataclass)Úisfinite)ÚEventÚThreadÚcurrent_threadÚlocal)ÚTYPE_CHECKINGÚLiteral)ÚLeaseSettingsMismatch)Úowner_is_stale)ÚMarkerSoftFileLockÚ	OwnerModeÚOwnerRecordÚparse_marker)Ú_read_lock_file)Úbreak_lock_fileÚtouch)ÚCallable)ÚLockOptions)ÚUnpackT)Úfrozenc                  óH   € ] tR t^$t$ RtR]R&   R]R&   R]R&   RtR]R	&   R
tR# )ÚLeaseCompromisez6Why a held lease stopped being this process's to hold.ÚstrÚ	lock_fileÚtokenÚCompromiseReasonÚreasonNúOSError | NoneÚerror© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r"   Ú__static_attributes__r#   ó    ÚP/home/luca/screen-checking/.venv/lib/python3.14/site-packages/filelock/_lease.pyr   r   $   s   ‡ á@àƒNØƒJØÓØ €Eˆ>× r+   r   c                  ó0   € ] tR t^.t$ RtR]R&   R]R&   RtR# )Ú
_HeartbeatzPA running heartbeat and the event that stops it, which only ever exist together.r   Úthreadr   Ústopr#   N)r$   r%   r&   r'   r(   r)   r*   r#   r+   r,   r.   r.   .   s   ‡ áZàƒNØ
‡Kr+   r.   c                  óF   € ] tR t^6t$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
Ú_LeaseClaimzNThe state of one claim: its token, its heartbeat, and how that claim was lost.Nú
str | Noner   úLeaseCompromise | NoneÚ
compromisez_Heartbeat | NoneÚ	heartbeatr#   )
r$   r%   r&   r'   r(   r   r)   r5   r6   r*   r#   r+   r,   r2   r2   6   s%   ‡ áXà€Eˆ:ÓØ)-€JÐ&Ó-Ø#'€IÐ ×'r+   r2   c                  ó&   € ] tR t^?tRtR R ltRtR# )Ú_LeaseClaimHolderz,Holds the claim its owning context acquired.c               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚNoner#   )Úformats   "r,   Ú__annotate__Ú_LeaseClaimHolder.__annotate__E   s   € ÷ #ñ #˜$ñ #r+   c                	ó$   € \        4       V n        R # ©N)r2   Úclaim©Úselfs   &r,   Ú__init__Ú_LeaseClaimHolder.__init__E   s   € Ü “]ˆŽ
r+   )rC   N)r$   r%   r&   r'   r(   rF   r*   r#   r+   r,   r8   r8   ?   s   † Ù6÷
#ñ #r+   r8   c                  ó   € ] tR t^ItRtRtR# )Ú_ThreadLocalLeaseClaimHolderz:A thread local version of the ``_LeaseClaimHolder`` class.r#   N)r$   r%   r&   r'   r(   r*   r#   r+   r,   rI   rI   I   s   † ÝDr+   rI   c                  óV  a € ] tR t^Mt$ RtRtR]R&   RtR]R&   RtR	]R
&   RRRRRR/R V 3R lllt	]
R R l4       t]
R R l4       t]
R R l4       t]
R R l4       tR V 3R lltR V 3R lltR V 3R lltR  V 3R! lltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR.tV ;t# )/ÚSoftFileLeasea‰  
Existence lock whose claim expires, so a peer may take it while the previous holder still runs.

A lease trades mutual exclusion for progress. The holder publishes a claim and refreshes it every
``heartbeat_interval`` seconds; a contender takes the marker once it is ``lease_duration`` seconds stale. Nothing
stops the expired holder: it keeps running, and it keeps using whatever the lock protects. Treat the lease as a hint
about who *should* be working, not as a guarantee that only one worker is.

To make a protected resource reject a superseded holder, that resource must be linearizable and must fence on a
monotonic generation it controls. :attr:`token` names a claim; it does not fence one. Where overlap is unacceptable,
use :class:`StrictSoftFileLock <filelock.StrictSoftFileLock>` instead.

Every contender for a path must agree on ``lease_duration``. A contender that finds a claim published under a
different duration raises :class:`LeaseSettingsMismatch <filelock.LeaseSettingsMismatch>` rather than apply its own
expiry to a peer that never agreed to it.

Expiry reclaims less on Windows, which refuses to rename or delete a file another process holds open. A peer there
takes an expired claim only once the previous holder's process exits and its handle closes; a holder that lives on
but stops refreshing keeps the marker. Unix reclaims the marker either way.

``on_compromise`` fires from the heartbeat thread when a refresh fails, or when the marker vanishes or names another
owner. The holder should stop touching the protected resource when it runs. Because it runs on that thread, a
``release()`` inside it only takes effect when the lease was built with ``thread_local=False``; the default
thread-local context hides the claim from every thread but the one that acquired it, so the release does nothing.
Signal the acquiring thread instead when the context stays thread-local.

.. versionadded:: 3.30.0

Úleaser   Ú_owner_modeFÚboolÚ_lifetime_supportedz(lease_duration sets when a lease expiresr   Ú_lifetime_unsupported_reasonÚlease_durationg      >@Úheartbeat_intervalNÚon_compromisec               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r;   r   zstr | os.PathLike[str]rQ   ÚfloatrR   zfloat | NonerS   z(Callable[[LeaseCompromise], None] | NoneÚkwargszUnpack[LockOptions]r<   r=   r#   )r>   s   "r,   r?   ÚSoftFileLease.__annotate__r   sG   € ÷ *ñ *à)ð*ð ð	*ð
 )ð*ð @ð*ð &ð*ð 
ñ*r+   c               ó   <€ \        V\        4      '       g   \        V\        \        34      '       g$   R\	        V4      P
                   2p\        V4      h\        V4      '       d   V^ 8:  d   RV: 2p\        V4      hVf
   V^,          p^ Tu;8  d   V8  g   M RV: 2p\        V4      h\        SV `(  ! V3/ VB  W n        W0n        W@n        V P                  4       '       d   \        M\         ! 4       V n        R# )a'  
Create a lease.

:param lease_duration: seconds of marker staleness after which a contender may take the claim. Every contender
    for the path must pass the same value.
:param heartbeat_interval: seconds between refreshes. Defaults to a third of ``lease_duration``, leaving room
    for two missed refreshes before a peer may take the claim. Must be shorter than ``lease_duration``.
:param on_compromise: called from the heartbeat thread with a :class:`LeaseCompromise` when the claim is lost.
:param kwargs: every other :class:`BaseFileLock <filelock.BaseFileLock>` option, ``timeout`` and ``mode`` among
    them. The metaclass passes them all by keyword, and taking them here lets
    :class:`AsyncSoftFileLease <filelock.AsyncSoftFileLease>` add the async plumbing a fixed signature would
    hide.

z5lease_duration must be a finite positive number, not z0lease_duration must be positive and finite, got NzBheartbeat_interval must be positive and below lease_duration, got )Ú
isinstancerN   ÚintrU   Útyper$   Ú	TypeErrorr   Ú
ValueErrorÚsuperrF   Ú_lease_durationÚ_heartbeat_intervalÚ_on_compromiseÚis_thread_localrI   r8   Ú_claims)rE   r   rQ   rR   rS   rV   ÚmsgÚ	__class__s   &&$$$, €r,   rF   ÚSoftFileLease.__init__r   sì   ø€ ô. �n¤d×+Ò+´:¸nÌsÔTYÈl×3[Ò3[ØIÌ$È~ÓJ^×JgÑJgÐIhÐiˆCÜ˜C“.Ð Ü˜×'Ò'¨>¸QÔ+>ØDÀ^ÑDVÐWˆCÜ˜S“/Ð!ØÒ%Ø!/°!Õ!3ÐØÐ%Ö6¨Ö6ØVÐWiÑVlÐmˆCÜ˜S“/Ð!Ü‰Ò˜Ñ- fÒ-Ø-ÔØ#5Ô Ø+Ôð -1×,@Ñ,@×,BÒ,BÕ(ÔHYÐYó+ˆŽr+   c               ó   € V ^8„  d   QhRR/# )r;   r<   r2   r#   )r>   s   "r,   r?   rW   Ÿ   s   € ÷ "ñ "˜ñ "r+   c                	ó.   € V P                   P                  # rB   )rc   rC   rD   s   &r,   Ú_claimÚSoftFileLease._claimž   s   € à�|‰|×!Ñ!Ð!r+   c               ó   € V ^8„  d   QhRR/# )r;   r<   rU   r#   )r>   s   "r,   r?   rW   £   s   € ÷ $ñ $ ñ $r+   c                ó   € V P                   # )zEThe staleness in seconds after which a contender may take this claim.)r_   rD   s   &r,   rQ   ÚSoftFileLease.lease_duration¢   s   € ð ×#Ñ#Ð#r+   c               ó   € V ^8„  d   QhRR/# )r;   r<   r3   r#   )r>   s   "r,   r?   rW   ¨   s   € ÷ !ñ !�zñ !r+   c                ó.   € V P                   P                  # )z¥
The token naming the claim this process published.

:returns: the token while the lease is held, ``None`` otherwise. It identifies a claim; it does not fence one.

)ri   r   rD   s   &r,   r   ÚSoftFileLease.token§   s   € ð �{‰{× Ñ Ð r+   c               ó   € V ^8„  d   QhRR/# )r;   r<   r4   r#   )r>   s   "r,   r?   rW   ²   s   € ÷ &ñ &Ð2ñ &r+   c                ó.   € V P                   P                  # )z}
The loss of claim the heartbeat observed.

:returns: the :class:`LeaseCompromise`, or ``None`` while the claim still holds

)ri   r5   rD   s   &r,   r5   ÚSoftFileLease.compromise±   s   € ð �{‰{×%Ñ%Ð%r+   c               ó   € V ^8„  d   QhRR/# r:   r#   )r>   s   "r,   r?   rW   »   s   € ÷ ñ ˜$ñ r+   c                	ót  <€ V P                   pV P                  4        \        P                  ! ^4      ;Vn        pRVn         \        SV `  4        T P                  P                  ;pe0   T P                  P                  ;p e   T P                  YYB4       R# RTn        R#   \         d
    RTn        h i ; i)é   N)ri   Ú_stop_heartbeatÚsecretsÚ	token_hexr   r5   r^   Ú_acquireÚBaseExceptionÚ_contextÚlock_file_fdÚlock_file_fd_identityÚ_start_heartbeat)rE   rC   r   ÚfdÚidentityre   s   &    €r,   rz   ÚSoftFileLease._acquire»   s¬   ø€ Ø—‘ˆØ×ÑÔä%×/Ò/°Ó3Ð3ˆŒ�eØˆÔð	Ü‰GÑÔð —-‘-×,Ñ,Ð,ˆBÒ9ØŸ™×;Ñ;Ð;ˆHØò?ð ×!Ñ! %¨XÖ=àˆEŽKøô ô 	ØˆEŒKØð	ús   ÁB# Â#B7c               ó   € V ^8„  d   QhRR/# r:   r#   )r>   s   "r,   r?   rW   Ï   s   € ÷ ñ ˜$ñ r+   c                	óf   <€ V P                  4        R V P                  n        \        SV `  4        R # rB   )rw   ri   r   r^   Ú_release©rE   re   s   &€r,   r…   ÚSoftFileLease._releaseÏ   s&   ø€ Ø×ÑÔØ ˆ�‰ÔÜ‰ÑÖr+   c               ó   € V ^8„  d   QhRR/# )r;   r<   r   r#   )r>   s   "r,   r?   rW   Ô   s   € ÷ rñ r ;ñ rr+   c                	ó~   <€ \         SV `  4       P                  V P                  P                  V P
                  R 7      # ))r   rQ   )r^   Ú_published_recordÚ_replaceri   r   r_   r†   s   &€r,   rŠ   ÚSoftFileLease._published_recordÔ   s2   ø€ Ü‰wÑ(Ó*×3Ñ3¸$¿+¹+×:KÑ:KÐ\`×\pÑ\pÐ3ÓqÐqr+   c               ó   € V ^8„  d   QhRR/# r:   r#   )r>   s   "r,   r?   rW   ×   s   € ÷ <ñ < tñ <r+   c                	ó°  <€ V P                  4       ;pf   \        SV `	  4        R # Vw  r#pVP                  R8w  d   R # VP                  V P
                  8w  d7   V P                   RVP                  : RV P
                  : R2p\        V4      h\        \        4      ;_uu_ 4        \        VP                  VP                  VP                  4      '       d"   \        V P                  W44        R R R 4       R # \        P                  ! 4       V,
          V P
                  8¼  d   \        V P                  W44       R R R 4       R #   + '       g   i     R # ; i)NrL   z holds a lease of z s but this contender configured z:s; every contender for a path must agree on lease_duration)Ú
_read_peerr^   Ú_try_break_stale_lockÚmoderQ   r_   r   r   r   ÚOSErrorr   ÚpidÚhostnameÚstartr   Útime)rE   ÚpeerÚownerÚmtimeÚinord   re   s   &     €r,   r�   Ú#SoftFileLease._try_break_stale_lock×   s  ø€ Ø—O‘OÓ%Ð%ˆDÒ.ô
 ‰GÑ)Ô+ÙØ Ñˆ�cð �:‰:˜Ô ÙØ×Ñ 4×#7Ñ#7Ô7à—>‘>Ð"Ð"4°U×5IÑ5IÑ4LÐLlØ×'Ñ'Ñ*Ð*dðfð ô (¨Ó,Ð,ô ”g×Õô ˜eŸi™i¨¯©¸¿¹×EÒEÜ §¡°Ô;Ø÷ Ñô �yŠy‹{˜UÕ" d×&:Ñ&:Ô:Ü §¡°Ô;÷ ××Òús   Â&A	EÃ9AEÅE	c               ó   € V ^8„  d   QhRR/# )r;   r<   z%tuple[OwnerRecord, float, int] | Noner#   )r>   s   "r,   r?   rW   õ   s   € ÷ ñ ÐAñ r+   c                	óä   € \        \        \        4      ;_uu_ 4        \        V P                  4      w  rp\        V4      ;pe   WBV3uuR R R 4       #  R R R 4       R #   + '       g   i     R # ; irB   )r   r’   r]   r   r   r   )rE   Úcontentr™   rš   r˜   s   &    r,   r�   ÚSoftFileLease._read_peerõ   s]   € Ü”gœz×*Õ*Ü"1°$·.±.Ó"AÑˆG˜CÜ% gÓ.Ð.�Ò;Ø SÐ(÷ +Ò*à;÷ +ñ ÷	 +Ö*ñ ús   �+AÁA/	c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r;   rC   r2   r€   rZ   r�   útuple[int, int]r   r   r<   r=   r#   )r>   s   "r,   r?   rW   ü   s1   € ÷ ñ  kð °sð Àoð Ð^að Ðfjñ r+   c                	ó¾   € \        4       p\        V P                  WW4V3R \        P                  ! 4        2RR7      p\        We4      Vn        VP                  4        R# )zfilelock-lease-T)ÚtargetÚargsÚnameÚdaemonN)r   r   Ú_refresh_until_stoppedÚosÚgetpidr.   r6   r•   )rE   rC   r€   r�   r   r0   r/   s   &&&&&  r,   r   ÚSoftFileLease._start_heartbeatü   sR   € ô ‹wˆÜØ×.Ñ.Ø˜X¨dÐ3Ø"¤2§9¢9£; -Ð0Øô	
ˆô % VÓ2ˆŒØ�‰Žr+   c               ó   € V ^8„  d   QhRR/# r:   r#   )r>   s   "r,   r?   rW     s   € ÷ 
Dñ 
D ñ 
Dr+   c                	ó8  € V P                   pVP                  ;pf   R # VP                  P                  4        R Vn        VP                  P
                  eC   VP                  \        4       Jd)   VP                  P                  V P                  R7       R # R # R # )N)Útimeout)	ri   r6   r0   Úsetr/   Úidentr	   Újoinr`   )rE   rC   r6   s   &  r,   rw   ÚSoftFileLease._stop_heartbeat  s~   € Ø—‘ˆØŸ™Ð(ˆIÒ1ÙØ�‰×ÑÔØˆŒð ×Ñ×!Ñ!Ò-°)×2BÑ2BÌ.ÓJZÓ2ZØ×Ñ×!Ñ!¨$×*BÑ*BÐ!ÖCñ 3[Ñ-r+   c               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r;   rC   r2   r€   rZ   r�   r¡   r   r   r0   r   r<   r=   r#   )r>   s   "r,   r?   rW     sF   € ÷ ñ àðð ðð "ð	ð
 ðð ðð 
ñr+   c                	óŽ  € \         P                  ! 4       pVP                  V P                  4      '       g�   V P	                  WW44      w  rxVR 8X  d   R# VR8X  d   \         P                  ! 4       pK\  \         P                  ! 4       V,
          V P
                  V P                  ,
          8¼  g   Kš  V P                  VRW„4       R# R# )ÚlostNÚokúrefresh-failed)r–   Ú	monotonicÚwaitr`   Ú_refresh_claimr_   Ú_report_compromise)	rE   rC   r€   r�   r   r0   Úlast_successÚoutcomer"   s	   &&&&&&   r,   r§   Ú$SoftFileLease._refresh_until_stopped  s—   € ô —~’~Ó'ˆØ—)‘)˜D×4Ñ4×5Ò5Ø!×0Ñ0°¸HÓL‰NˆGØ˜&Ô ÙØ˜$ŒÜ#Ÿ~š~Ó/’Ü—’Ó! LÕ0°D×4HÑ4HÈ4×KcÑKcÕ4cÖcØ×'Ñ'¨Ð/?ÀÔNÙñ 6r+   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r;   rC   r2   r€   rZ   r�   r¡   r   r   r<   z&tuple[_RefreshOutcome, OSError | None]r#   )r>   s   "r,   r?   rW   0  s<   € ÷ ñ àðð ðð "ð	ð
 ðð 
0ñr+   c                	óž  €  \         P                  ! V P                  4      pTP                  TP                  3T8w  d   T P	                  TRRT4       R#  \        T P                  TR7       R#   \         d    pT P	                  TR Yd4       Ru Rp?# Rp?i\
         d   pRT3u Rp?# Rp?ii ; i  \
         d   pRT3u Rp?# Rp?ii ; i)úmarker-missingNÚ	transientúowner-changed)r€   )r´   N)rµ   N)	r¨   Úlstatr   ÚFileNotFoundErrorrº   r’   Úst_devÚst_inor   )rE   rC   r€   r�   r   Ústr"   s   &&&&&  r,   r¹   ÚSoftFileLease._refresh_claim0  sÀ   € ð	&Ü—’˜$Ÿ.™.Ó)ˆBð �I‰I�r—y‘yÐ! XÔ-Ø×#Ñ# E¨?¸DÀ%ÔHØÐð	&Ü�$—.‘. RÕ(ð Ðøô !ô 	 Ø×#Ñ# EÐ+;¸UÔJØÕûÜô 	&Ø Ð%Õ%ûð	&ûô ô 	&Ø Ð%Õ%ûð	&úsS   ‚ A/ ÁB3 Á/B0Á:BÂB0ÂB0Â!B0Â"B+Â%B0Â+B0Â3CÂ>CÃCÃCc          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r;   rC   r2   r    r   r"   r!   r   r   r<   r=   r#   )r>   s   "r,   r?   rW   H  s<   € ÷ 2ñ 2àð2ð !ð2ð ð	2ð
 ð2ð 
ñ2r+   c                	ó–   € \        V P                  WBVR 7      Vn        V P                  e   V P                  VP                  4       R# R# ))r   r   r    r"   N)r   r   r5   ra   )rE   rC   r    r"   r   s   &&&&&r,   rº   Ú SoftFileLease._report_compromiseH  s?   € ô +°T·^±^È5ÐglÔmˆÔØ×ÑÒ*Ø×Ñ × 0Ñ 0Ö1ñ +r+   )rc   r`   r_   ra   )r$   r%   r&   r'   r(   rM   r)   rO   rP   rF   Úpropertyri   rQ   r   r5   rz   r…   rŠ   r�   r�   r   rw   r§   r¹   rº   r*   Ú__classcell__)re   s   @r,   rK   rK   M   sõ   ø‡ ñð< %€K�Ó$ð !&Ð˜Ó%Ø(RÐ  #ÓRð*ð !%ð	*ð
 ,0ð*ð CG÷*ò *ðX ô"ó ð"ð ô$ó ð$ð ô!ó ð!ð ô&ó ð&÷ð ÷(ð ÷
rð r÷<ð <õ<õõ 
Dõõ0÷02ó 2r+   rK   )é   é   )rÀ   rÂ   r¶   Úevicted)rµ   r´   rÁ   )r   r   rK   )2Ú
__future__r   r¨   rx   r–   Ú
contextlibr   Údataclassesr   Úmathr   Ú	threadingr   r   r	   r
   Útypingr   r   Ú_errorr   Ú	_identityr   Ú_markerr   r   r   r   Ú_softr   Ú_utilr   r   ÚsysÚcollections.abcr   Ú_apir   Úversion_infor   Útyping_extensionsr   Ú_RefreshOutcomer   r.   r2   r8   rI   rK   Ú__all__r#   r+   r,   Ú<module>rã      sõ   ðÝ "ã 	Û Û Ý Ý !Ý ß :Ó :ß )å )Ý %ß MÓ MÝ "ß )çÛÝ(å!à
×Ñ˜7Ô"Þ!å,ð ÐYÕZÐ àÐ3Õ4€ñ �$Ô÷!ð !ó ð!ñ �$Ô÷ð ó ðð ÷(ð (ó ð(÷#ñ #ôEÐ#4°eô EôG2Ð&ô G2òT‚r+   