o
    Y¾±h‰  ã                   @  sZ   d dl mZ d dlZd dlZd dlmZmZ d dlmZ er$d dl	m
Z
 G dd„ dƒZdS )é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)Úutil)ÚTracebackTypec                   @  s8   e Zd ZdZddd„Zdd
d„Zddd„Zddd„ZdS )ÚTemporaryDirectorya™  Temporary directory context manager.

    Creates a temporary directory that exists within the context manager scope.
    It returns the path to the created directory.
    Wrapper on top of tempfile.mkdtemp.

    Parameters
    ----------
    suffix : str or None
        Suffix to the filename.
    prefix : str or None
        Prefix to the filename.
    dir : str or None
        Enclosing directory.

    Úargsr   ÚkwargsÚreturnÚNonec                 O  s   || _ || _d | _d S ©N)Ú_argsÚ_kwargsÚ_path)Úselfr   r	   © r   ú^/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/streamlit/temporary_directory.pyÚ__init__0   s   
zTemporaryDirectory.__init__Ústrc                 C  s
   t  | ¡S r   )r   Úrepr_©r   r   r   r   Ú__repr__5   s   
zTemporaryDirectory.__repr__c                 C  s   t j| ji | j¤Ž| _| jS r   )ÚtempfileÚmkdtempr   r   r   r   r   r   r   Ú	__enter__8   s   zTemporaryDirectory.__enter__Úexc_typeútype[BaseException] | NoneÚ	exc_valueúBaseException | NoneÚexc_tracebackúTracebackType | Nonec                 C  s   | j rt | j ¡ d S d S r   )r   ÚshutilÚrmtree)r   r   r   r   r   r   r   Ú__exit__<   s   ÿzTemporaryDirectory.__exit__N)r   r   r	   r   r
   r   )r
   r   )r   r   r   r   r   r    r
   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r#   r   r   r   r   r      s    


r   )Ú
__future__r   r!   r   Útypingr   r   Ú	streamlitr   Útypesr   r   r   r   r   r   Ú<module>   s   