§
    ¸)ýf  ã                   ób   — 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dS )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                  ó8   — t                                ¦   «          dS )zClear the cache entirely.N)ÚcacheÚclear© ó    úU/home/blender/git/blender-v430/install_release/4.3/python/lib/python3.11/linecache.pyr   r      s   € å	‡K‚K�M„M€M€M€Mr   c                 óv   — t          | |¦  «        }d|cxk    rt          |¦  «        k    rn n||dz
           S dS )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      sO   € õ �X˜~Ñ.Ô.€EØˆFÐ Ð Ò Ð •c˜%‘j”jÒ Ð Ð Ð Ð Ø�V˜a‘ZÔ Ð Øˆ2r   c                 óÜ   — | t           v r3t           |          }t          |¦  «        dk    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   $   sx   € ð •5ÐÐÝ�h”ˆÝˆu‰:Œ:˜Š?ˆ?Ý˜”? 1Ô%Ð%ðÝ˜8 ^Ñ4Ô4Ð4øÝð ð ð Ý‰ŒˆØˆ	ˆ	ˆ	ðøøøs   ¾A ÁA+Á*A+c                 óº  — | €'t          t                               ¦   «         ¦  «        }n| t          v r| g}ndS |D ]Ÿ} t          |          }t          |¦  «        dk    rŒ#|\  }}}}|€Œ-	 t	          j        |¦  «        }n+# t          $ r t                               | d¦  «         Y Œjw xY w||j        k    s||j	        k    rt                               | d¦  «         Œ dS )zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr   )
Úlistr   Úkeysr   ÚosÚstatÚOSErrorÚpopÚst_sizeÚst_mtime)r   Ú	filenamesr   ÚsizeÚmtimer   Úfullnamer   s           r   r   r   4   sþ   € ð ÐÝ�Ÿš™œÑ&Ô&ˆ	ˆ	Ø	•UÐ	Ð	Ø�Jˆ	ˆ	àˆàð &ð &ˆÝ�h”ˆÝˆu‰:Œ:˜Š?ˆ?àØ',Ñ$ˆˆe�U˜HØˆ=Øð	Ý”7˜8Ñ$Ô$ˆDˆDøÝð 	ð 	ð 	Ý�IŠI�h Ñ%Ô%Ð%ØˆHð	øøøð �4”<ÒÐ 5¨D¬MÒ#9Ð#9Ý�IŠI�h Ñ%Ô%Ð%øð&ð &s   Á)A>Á>%B&Â%B&c                 óä  — | t           v r9t          t           |          ¦  «        dk    rt                                | d¦  «         | r*|                      d¦  «        r|                      d¦  «        rg S | }	 t          j        |¦  «        }�n<# t          $ �r. | }t          | |¦  «        r„	 t          |          d         ¦   «         }|€g cY S t          |¦  «        dd„ | 	                    ¦   «         D ¦   «         |ft           | <   t           |          d         cY S # t          t          f$ r Y nw xY wt
          j                             | ¦  «        rg cY S t          j        D ]a}	 t
          j                             ||¦  «        }n# t          t           f$ r Y Œ7w xY w	 t          j        |¦  «        } n# t          $ r Y Œ^w xY wg cY S Y nw xY w	 t#          j        |¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   n# t          t(          t*          f$ r g cY S w xY w|r+|d                              d	¦  «        s|dxx         d	z  cc<   |j        |j        }
}	|	|
||ft           | <   |S )
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   c                 ó   — g | ]}|d z   ‘ŒS )ú
r
   )Ú.0Úlines     r   ú
<listcomp>zupdatecache.<locals>.<listcomp>p   s   € Ð?Ð?Ð? T�T˜D‘[Ð?Ð?Ð?r   r   éÿÿÿÿr,   )r   r   r!   Ú
startswithÚendswithr   r   r    r   Ú
splitlinesÚImportErrorÚpathÚisabsÚsysÚjoinÚ	TypeErrorÚAttributeErrorÚtokenizeÚopenÚ	readlinesÚUnicodeDecodeErrorÚSyntaxErrorr"   r#   )r   r   r'   r   ÚbasenameÚdataÚdirnameÚfpr   r%   r&   s              r   r   r   P   s  € ð
 •5ÐÐÝ�u�XŒÑÔ 1Ò$Ð$Ý�IŠI�h Ñ%Ô%Ð%Øð ˜×+Ò+¨CÑ0Ô0ð °X×5FÒ5FÀsÑ5KÔ5Kð Øˆ	à€Hð*ÝŒw�xÑ Ô ˆ‰øÝð (ñ (ð (Øˆõ �X˜~Ñ.Ô.ð 	*ð*Ý˜X” qÔ)Ñ+Ô+�ð �<ð �I�I�Iå˜‘I”IØØ?Ð?¨T¯_ª_Ñ->Ô->Ð?Ñ?Ô?Øð	#•�h‘õ ˜X” qÔ)Ð)Ð)Ð)øõ  ¥Ð)ð ð ð Ø�ðøøøõ" Œ7�=Š=˜Ñ"Ô"ð 	ØˆIˆIˆIå”xð 	ð 	ˆGðÝœ7Ÿ<š<¨°Ñ:Ô:��øÝ�~Ð.ð ð ð à�ðøøøðÝ”w˜xÑ(Ô(�Ø�øÝð ð ð Ø�ðøøøð ˆIˆIˆIð	 �ðI(øøøðRÝŒ]˜8Ñ$Ô$ð 	#¨Ø—L’L‘N”NˆEð	#ð 	#ð 	#ñ 	#ô 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#øøøð 	#ð 	#ð 	#ð 	#øøåÕ'­Ð5ð ð ð Øˆ	ˆ	ˆ	ðøøøàð �U˜2”Y×'Ò'¨Ñ-Ô-ð Øˆbˆ	ˆ	Œ	�TÑˆ	ˆ	‰	Ø”, ¤ˆ%€DØ˜E 5¨(Ð2…Eˆ(�OØ€LsÁ   Á4B
 Â
GÂ(DÃGÃA
GÄD(Ä%GÄ'D(Ä($GÅGÅ E>Å=GÅ>FÆGÆFÆGÆF,Æ*GÆ,
F9Æ6GÆ8F9Æ9GÇGÇH ÇG<Ç0H Ç<H È H ÈH ÈH ÈH$È#H$c                 óÞ  — | t           v r"t          t           |          ¦  «        dk    rdS dS | r*|                      d¦  «        r|                      d¦  «        rdS |r‘d|v r�|                     d¦  «        }t          |dd	¦  «        p|d         }t          |d
d	¦  «        }|€|                     d¦  «        }t          |dd	¦  «        }|r$|r"t          j        ||¦  «        }|ft           | <   dS dS )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   r1   r2   ÚgetÚgetattrÚ	functoolsÚpartial)r   r   ÚspecrG   rH   rJ   Ú	get_liness          r   r   r   “   s  € ð •5ÐÐÝ�u�XŒÑÔ 1Ò$Ð$Ø�4à�5Øð ˜×+Ò+¨CÑ0Ô0ð °X×5FÒ5FÀsÑ5KÔ5Kð Øˆuàð ˜*¨Ð6Ð6Ø×!Ò! *Ñ-Ô-ˆÝ�t˜V TÑ*Ô*ÐH¨n¸ZÔ.HˆÝ˜˜x¨Ñ.Ô.ˆØˆ>Ø#×'Ò'¨Ñ5Ô5ˆFÝ˜V \°4Ñ8Ô8ˆ
àð 	�Jð 	Ý!Ô)¨*°dÑ;Ô;ˆIØ(˜l�E�(‰OØ�4Øˆ5r   )N)Ú__doc__rM   r7   r   r;   Ú__all__r   r   r   r   r   r   r   r
   r   r   ú<module>rS      sÇ   ððð ð Ð Ð Ð Ø 
€
€
€
Ø 	€	€	€	Ø €€€à
>Ð
>Ð
>€ð
 	€ðð ð ð
ð ð ð ðð ð ð ð &ð &ð &ð &ð8@ð @ð @ð @ðF!ð !ð !ð !ð !r   