Ë
    ì—0j¨  ã                   ó`   — d Z ddlZddlZddlZddlZg d¢Zi Zd„ Zd
d„Zd
d„Z	d
d„Z
d
d„Zd	„ Zy)zÃCache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
é    N)ÚgetlineÚ
clearcacheÚ
checkcacheÚ	lazycachec                  ó,   — t         j                  «        y)zClear the cache entirely.N)ÚcacheÚclear© ó    ú&/usr/local/lib/python3.12/linecache.pyr   r      s   € ä	‡K�K…Mr   c                 óZ   — t        | |«      }d|cxk  rt        |«      k  rn y||dz
     S y)z~Get a line for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.é   Ú )ÚgetlinesÚlen)ÚfilenameÚlinenoÚmodule_globalsÚliness       r   r   r      s8   € ô �X˜~Ó.€EØˆFÔ ”c˜%“jÔ àð �V˜a‘ZÑ Ð Ør   c                 ó¨   — | t         v r#t         |    }t        |«      dk7  rt         |    d   S 	 t        | |«      S # t        $ r t	        «        g cY S w xY w)z�Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.r   é   )r   r   ÚupdatecacheÚMemoryErrorr   )r   r   Úentrys      r   r   r   $   sZ   € ð ”5ÑÜ�h‘ˆÜˆu‹:˜Š?Ü˜‘? 1Ñ%Ð%ðÜ˜8 ^Ó4Ð4øÜò ÜŒØŠ	ðús   ­9 ¹AÁAc                 ó²  — | €#t         j                  «       j                  «       }n| g}|D ]p  } 	 t         |    }t	        |«      dk(  rŒ|\  }}}}|€Œ&	 t        j                  |«      }||j                  k7  s||j                  k7  sŒ[t         j                  | d«       Œr y# t        $ r Y Œw xY w# t        t        f$ r t         j                  | d«       Y Œªw xY w)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr   )r   ÚcopyÚkeysÚKeyErrorr   ÚosÚstatÚOSErrorÚ
ValueErrorÚpopÚst_sizeÚst_mtime)r   Ú	filenamesr   ÚsizeÚmtimer   Úfullnamer    s           r   r   r   4   s×   € ð Ðä—J‘J“L×%Ñ%Ó'‰	à�Jˆ	ãˆð	Ü˜(‘OˆEô ˆu‹:˜Š?àØ',Ñ$ˆˆe�U˜HØˆ=Øð	Ü—7‘7˜8Ó$ˆDð �4—<‘<Ò 5¨D¯M©MÓ#9Ü�I‰I�h Õ%ñ% øô ò 	Ùð	ûô œÐ$ò 	Ü�I‰I�h Ô%Ùð	ús#   ¯	BÁB.Â	B+Â*B+Â.%CÃCc                 ó¦  — | t         v r+t        t         |    «      dk7  rt         j                  | d«       | r"| j                  d«      r| j	                  d«      rg S | }	 t        j                  |«      }	 t%        j&                  |«      5 }|j)                  «       }	ddd«       	r!|	d   j	                  d«      s|	dxx   dz  cc<   |j.                  |j0                  }}
|
||	|ft         | <   |	S # t        $ �r& | }t        | |«      ru	 t        |    d   «       }|€g cY S t        |«      d|j                  «       D �cg c]  }|dz   ‘Œ	 nc c}w c}|ft         | <   t         |    d   cY S # t        t        f$ r Y nw xY wt
        j                  j                  | «      rg cY S t        j                  D ]e  }	 t
        j                  j                  ||«      }n# t        t         f$ r Y Œ6w xY w	 t        j                  |«      } n# t        t"        f$ r Y Œcw xY w g cY S Y �Œ¨t"        $ r g cY S w xY w# 1 sw Y   �Œ“xY w# t        t*        t,        f$ r g cY S w xY w)	z”Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.r   NÚ<Ú>r   Ú
r   éÿÿÿÿ)r   r   r#   Ú
startswithÚendswithr   r    r!   r   Ú
splitlinesÚImportErrorÚpathÚisabsÚsysÚjoinÚ	TypeErrorÚAttributeErrorr"   ÚtokenizeÚopenÚ	readlinesÚUnicodeDecodeErrorÚSyntaxErrorr$   r%   )r   r   r)   r    ÚbasenameÚdataÚlineÚdirnameÚfpr   r'   r(   s               r   r   r   S   s>  € ð
 ”5ÑÜŒu�X‰Ó 1Ò$Ü�I‰I�h Ô%Ù˜×+Ñ+¨CÔ0°X×5FÑ5FÀsÔ5KØˆ	à€Hð,Ü�w‰w�xÓ ˆðXÜ�]‰]˜8Ô$¨Ø—L‘L“NˆE÷ %ñ �U˜2‘Y×'Ñ'¨Ô-Øˆb‹	�TÑ‹	Ø—,‘, §¡ˆ%€DØ˜E 5¨(Ð2„Eˆ(�OØ€Løôi ó (Øˆô �X˜~Ô.ð*Ü˜X‘ qÑ)Ó+�ð �<ð ’Iä˜“IØØ-1¯_©_Ô->Ó?Ñ-> T�T˜D“[Ñ->ùÔ?Øð	#”�h‘ô ˜X‘ qÑ)Ò)øô  ¤Ð)ò Ùðúô" �7‰7�=‰=˜Ô"ØŠIä—x”xˆGðÜŸ7™7Ÿ<™<¨°Ó:‘øÜœ~Ð.ò áðúðÜ—w‘w˜xÓ(�ÙøÜœZÐ(ò Ùðúð  ð ŠIò	 ô
 ò ØŠ	ðú÷ %Ñ$ûäÔ'¬Ð5ò ØŠ	ðúsÆ   ÁC+ Á3H7 ÂH*ÂH7 Ã+H'ÄE#ÄH'ÄH'Ä7E
ÅH'Å#E5Å2H'Å4E5Å5$H'ÆH'Æ/ GÇH'ÇG"ÇH'Ç!G"Ç"H'Ç&G=Ç;H'Ç=HÈH'ÈHÈH'È
H'È&H'È*H4È/H7 È7IÉIc                 ó†  — | t         v rt        t         |    «      dk(  ryy| r"| j                  d«      r| j                  d«      ry|r{d|v rw|j	                  d«      }t        |dd	«      xs |d   }t        |d
d	«      }|€|j	                  d«      }t        |dd	«      }|r#|r!t        j                  ||«      }|ft         | <   yy)aî  Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cacheable
        filename, and the filename must not be already cached.
    r   TFr+   r,   Ú__name__Ú__spec__ÚnameNÚloaderÚ
__loader__Ú
get_source)r   r   r/   r0   ÚgetÚgetattrÚ	functoolsÚpartial)r   r   ÚspecrF   rG   rI   Ú	get_liness          r   r   r   ˜   sÎ   € ð ”5ÑÜŒu�X‰Ó 1Ò$ØàÙ˜×+Ñ+¨CÔ0°X×5FÑ5FÀsÔ5KØá˜*¨Ñ6Ø×!Ñ! *Ó-ˆÜ�t˜V TÓ*ÒH¨n¸ZÑ.HˆÜ˜˜x¨Ó.ˆØˆ>Ø#×'Ñ'¨Ó5ˆFÜ˜V \°4Ó8ˆ
á‘JÜ!×)Ñ)¨*°dÓ;ˆIØ(˜lŒE�(‰OØØr   )N)Ú__doc__rL   r5   r   r9   Ú__all__r   r   r   r   r   r   r   r
   r   r   Ú<module>rR      sD   ðñó Û 
Û 	Û â
>€ð
 	€òó
óó &ó>BóJ!r   