ó
    áÅŸg’  ã                   ó0  • S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	J
r
  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  \R0                  S:¼  a  SSKJr  OSSKJr   " S S\5      rS\4S jr\" 5       rS\S\4S jr\	 " S S5      5       rg)z;Caching of formatted files with feature-based invalidation.é    N)ÚIterable)Ú	dataclassÚfield)ÚPath)Ú
NamedTuple)Úuser_cache_dir)Úversion)ÚMode)Úerr)é   é   )ÚSelfc                   ó4   • \ rS rSr% \\S'   \\S'   \\S'   Srg)ÚFileDataé   Úst_mtimeÚst_sizeÚhash© N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚfloatÚ__annotations__ÚintÚstrÚ__static_attributes__r   ó    ÚL/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/black/cache.pyr   r      s   ‡ ØƒOØƒLØ
†Ir   r   Úreturnc                  ó€   • [        S5      n [        [        R                  R	                  SU 5      5      nU[
        -  nU$ )aC  Get the cache directory used by black.

Users can customize this directory on all systems using `BLACK_CACHE_DIR`
environment variable. By default, the cache directory is the user cache directory
under the black application.

This result is immediately set to a constant `black.cache.CACHE_DIR` as to avoid
repeated calls.
ÚblackÚBLACK_CACHE_DIR)r   r   ÚosÚenvironÚgetÚ__version__)Údefault_cache_dirÚ	cache_dirs     r    Úget_cache_dirr+      s:   € ô ' wÓ/ÐÜ”R—Z‘Z—^‘^Ð$5Ð7HÓIÓJ€IØœKÑ'€IØÐr   Úmodec                 ó8   • [         SU R                  5        S3-  $ )Nzcache.z.pickle)Ú	CACHE_DIRÚget_cache_key)r,   s    r    Úget_cache_filer0   3   s    € Ü˜ × 2Ñ 2Ó 4Ð5°WÐ=Ñ=Ð=r   c                   óö   • \ rS rSr% \\S'   \\S'   \" \S9r	\\
\4   \S'   \S\S\4S j5       r\S\S\
4S	 j5       r\S\S\4S
 j5       rS\S\4S jrS\\   S\\\   \\   4   4S jrS\\   SS4S jrSrg)ÚCacheé7   r,   Ú
cache_file)Údefault_factoryÚ	file_datar!   c           	      ó  • [        U5      n UR                  5       nU(       d  U " X5      $ UR	                  S5       n [
        R                  " U5      nUR                  5        VVs0 sH  u  pxU[        U6 _M     n	nn SSS5        U " XW	5      $ ! [         a#  n[        SU SU 35        U " X5      s SnA$ SnAff = fs  snnf ! [
        R                  [        [        4 a    U " X5      s sSSS5        $ f = f! , (       d  f       Nƒ= f)z}Read the cache if it exists and is well-formed.

If it is not well-formed, the call to write later should
resolve the issue.
zUnable to read cache file z due to NÚrb)r0   ÚexistsÚOSErrorr   ÚopenÚpickleÚloadÚitemsr   ÚUnpicklingErrorÚ
ValueErrorÚ
IndexError)
Úclsr,   r4   r9   ÚeÚfobjÚdataÚkÚvr6   s
             r    ÚreadÚ
Cache.read=   sü   € ô $ DÓ)ˆ
ð	)Ø×&Ñ&Ó(ˆFö
 Ù�tÓ(Ð(à�_‰_˜TÔ" dð-Ü:@¿+º+ÀdÓ:K�Ø9=¿¹¼ÔF¹±°˜Q¤¨! š_¹�	ÑF�	÷ #ñ �4 YÓ/Ð/øô ó 	)äÐ,¨Z¨L¸ÀÀÐDÔEÙ�tÓ(Õ(ûð	)üó GøÜ×*Ñ*¬J¼
ÐCó -Ù˜4Ó,Ñ,÷ #Ñ"ð-ú÷	 #Õ"úsW   �B ½C=¿)CÁ(CÁ<CÂ
B>ÂB9Â3B>Â9B>ÃCÃ'C:Ã.C=Ã9C:Ã:C=Ã=
DÚpathc                 ój   • U R                  5       n[        R                  " U5      R                  5       $ )zReturn hash digest for path.)Ú
read_bytesÚhashlibÚsha256Ú	hexdigest)rJ   rE   s     r    Úhash_digestÚCache.hash_digestW   s(   € ð �‰Ó ˆÜ�~Š~˜dÓ#×-Ñ-Ó/Ð/r   c                 óŽ   • U R                  5       n[        R                  U 5      n[        UR                  UR
                  U5      $ )zReturn file data for path.)Ústatr2   rP   r   r   r   )rJ   rS   r   s      r    Úget_file_dataÚCache.get_file_data^   s6   € ð �y‰y‹{ˆÜ× Ñ  Ó&ˆÜ˜Ÿ™ t§|¡|°TÓ:Ð:r   Úsourcec                 óH  • UR                  5       nU R                  R                  [        U5      5      nUc  gUR	                  5       nUR
                  UR
                  :w  a  gUR                  UR                  :w  a%  [        R                  U5      nXSR                  :w  a  gg)z7Check if source has changed compared to cached version.TF)
Úresolver6   r'   r   rS   r   r   r2   rP   r   )ÚselfrV   Úres_srcÚoldÚstÚnew_hashs         r    Ú
is_changedÚCache.is_changedf   s|   € à—.‘.Ó"ˆØ�n‰n× Ñ ¤ W£Ó.ˆØ‰;Øà�\‰\‹^ˆØ�:‰:˜Ÿ™Ó$ØØ�;‰;˜#Ÿ,™,Ó&Ü×(Ñ(¨Ó1ˆHØŸ8™8Ó#ØØr   Úsourcesc                 ó¶   • [        5       n[        5       nU H=  nU R                  U5      (       a  UR                  U5        M,  UR                  U5        M?     X#4$ )z¹Split an iterable of paths in `sources` into two sets.

The first contains paths of files that modified on disk or are not in the
cache. The other contains paths to non-modified files.
)Úsetr^   Úadd)rY   r`   ÚchangedÚdoneÚsrcs        r    Úfiltered_cachedÚCache.filtered_cachedv   sL   € ô !›UˆÜ›%ˆÛˆCØ�‰˜s×#Ñ#Ø—‘˜CÖ à—‘˜–ñ	 ð
 ˆ}Ðr   Nc                 óŒ  • U R                   R                  " S0 U Vs0 sH0  n[        UR                  5       5      [        R                  U5      _M2     snD6   [        R                  SSS9  [        R                  " [        U R                  R                  5      SS9 nU R                   R                  5        VVs0 sH  u  pEU/ UQ7_M     nnn[        R                  " XcSS9  SSS5        [        R                   " WR"                  U R                  5        gs  snf s  snnf ! , (       d  f       NE= f! [$         a     gf = f)	z6Update the cache file data and write a new cache file.T)ÚparentsÚexist_okF)ÚdirÚdeleteé   )ÚprotocolNr   )r6   Úupdater   rX   r2   rT   r.   ÚmkdirÚtempfileÚNamedTemporaryFiler4   Úparentr>   r<   Údumpr%   ÚreplaceÚnamer:   )rY   r`   rf   ÚfrF   rG   rE   s          r    ÚwriteÚCache.write…   s  € à�‰×Òñ 	
ÙGNÓOÁwÀŒs�3—;‘;“=Ó!¤5×#6Ñ#6°sÓ#;Ò;ÁwÑOò	
ð	Ü�O‰O D°4ˆOÑ8Ü×,Ò,Ü˜Ÿ™×.Ñ.Ó/¸òàð *.¯©×)=Ñ)=Ô)?ô;Ù)?¡ �A�u˜‘u’HÑ)?ð ñ ;ô —’˜D¨aÒ0÷ô �JŠJ�q—v‘v˜tŸ™Õ/ùò Pùó;÷	õ ûô ó 	Ùð	úsB   �6DÁAD6 ÂD%Â=DÃD%Ã&3D6 ÄD%Ä%
D3Ä/D6 Ä6
EÅEr   )r   r   r   r   r
   r   r   r   Údictr6   r   r   Úclassmethodr   rH   ÚstaticmethodrP   rT   Úboolr^   r   Útuplerb   rg   ry   r   r   r   r    r2   r2   7   sÜ   ‡ à
ƒJØÓÙ%*¸4Ñ%@€Iˆt�C˜�MÑ"Ó@àð0˜ð 0 ó 0ó ð0ð2 ð0˜$ð 0 3ó 0ó ð0ð ð;˜Dð ; Xó ;ó ð;ð ð ¨$ô ð  x°¡~ð ¸%ÀÀDÁ	È3ÈtÉ9Ð@TÑ:Uô ð˜X d™^ð °÷ r   r2   ) Ú__doc__rM   r%   r<   Úsysrr   Úcollections.abcr   Údataclassesr   r   Úpathlibr   Útypingr   Úplatformdirsr   Ú_black_versionr	   r(   Ú
black.moder
   Úblack.outputr   Úversion_infor   Útyping_extensionsr   r+   r.   r0   r2   r   r   r    Ú<module>rŒ      s“   ðÙ Aã Û 	Û Û 
Û Ý $ß (Ý Ý å 'å 1Ý Ý à×Ñ�wÓÞå&ôˆzô ð�tô ñ" ‹O€	ð>˜ð > $ô >ð ÷^ð ^ó ñ^r   