Ë
    úmxi0  ã                  ód   — d dl mZ d dlZd dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ  G d„ d«      Zy)	é    )ÚannotationsN)ÚAny)Úconfig)Úmagic)Úopen_python_filec                  ó(   — e Zd ZdZdd„Zdd„Zdd„Zy)ÚScriptCachez,Thread-safe cache of Python script bytecode.c                óD   — i | _         t        j                  «       | _        y )N)Ú_cacheÚ	threadingÚLockÚ_lock©Úselfs    úb/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_cache.pyÚ__init__zScriptCache.__init__   s   € à&(ˆŒÜ—^‘^Ó%ˆ�
ó    c                óz   — | j                   5  | j                  j                  «        ddd«       y# 1 sw Y   yxY w)z~Remove all entries from the cache.

        Notes
        -----
        Threading: SAFE. May be called on any thread.
        N)r   r   Úclearr   s    r   r   zScriptCache.clear"   s0   € ð �Z‰Zñ 	 Ø�K‰K×ÑÔ÷	 ÷ 	 ñ 	 ús   �1±:c           	     óÐ  — t         j                  j                  |«      }| j                  5  | j                  j                  |d«      }|�|cddd«       S t        |«      5 }|j                  «       }ddd«       t        j                  d«      rt        j                  |«      }t        |dddd¬«      }|| j                  |<   |cddd«       S # 1 sw Y   Œ_xY w# 1 sw Y   yxY w)a\  Return the bytecode for the Python script at the given path.

        If the bytecode is not already in the cache, the script will be
        compiled first.

        Raises
        ------
        Any Exception raised while reading or compiling the script.

        Notes
        -----
        Threading: SAFE. May be called on any thread.
        Nzrunner.magicEnabledÚexecr   é   éÿÿÿÿ)ÚmodeÚflagsÚdont_inheritÚoptimize)ÚosÚpathÚabspathr   r   Úgetr   Úreadr   Ú
get_optionr   Ú	add_magicÚcompile)r   Úscript_pathÚbytecodeÚfÚfilebodys        r   Úget_bytecodezScriptCache.get_bytecode,   sÜ   € ô —g‘g—o‘o kÓ2ˆà�Z‰Zñ 	Ø—{‘{—‘ {°DÓ9ˆHØÐ#à÷		ñ 	ô " +Ó.ð $°!ØŸ6™6›8�÷$ô × Ñ Ð!6Ô7Ü Ÿ?™?¨8°[ÓA�äØàð àØàôˆHð (0ˆD�K‰K˜Ñ$Ø÷9	ñ 	÷$ð $ú÷	ð 	ús*   ¬ CÁCÁ!CÁ2ACÃC	ÃCÃC%N)ÚreturnÚNone)r&   Ústrr+   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r*   © r   r   r	   r	      s   „ Ù6ó&ó
 ô-r   r	   )Ú
__future__r   Úos.pathr   r   Útypingr   Ú	streamlitr   Ústreamlit.runtime.scriptrunnerr   Ústreamlit.source_utilr   r	   r2   r   r   ú<module>r9      s&   ðõ #ã Û Ý å Ý 0Ý 2÷?ò ?r   