o
    æ²ªg[  ã                   @  s:   d dl mZ d dlZd dlZd dlmZ G dd„ dƒZdS )é    )ÚannotationsN)Úutilc                   @  s2   e Zd ZdZdd„ Zddd„Zdd	„ Z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.

    c                 O  s   || _ || _d S ©N)Ú_argsÚ_kwargs)ÚselfÚargsÚkwargs© r   úY/var/www/html/chatdoc2/venv/lib/python3.10/site-packages/streamlit/temporary_directory.pyÚ__init__,   s   
zTemporaryDirectory.__init__ÚreturnÚstrc                 C  s
   t  | ¡S r   )r   Úrepr_©r   r   r   r   Ú__repr__0   s   
zTemporaryDirectory.__repr__c                 C  s   t j| ji | j¤Ž| _| jS r   )ÚtempfileÚmkdtempr   r   Ú_pathr   r   r   r   Ú	__enter__3   s   zTemporaryDirectory.__enter__c                 C  s   t  | j¡ d S r   )ÚshutilÚrmtreer   )r   Úexc_typeÚ	exc_valueÚexc_tracebackr   r   r   Ú__exit__7   s   zTemporaryDirectory.__exit__N)r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s    
r   )Ú
__future__r   r   r   Ú	streamlitr   r   r   r   r   r   Ú<module>   s
   