U
    ˜ARdÂ  ã                   @   sÂ   d dl mZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ de	ƒZ
G dd„ de	ƒZG dd„ de	eƒZG dd„ deƒZdS )é    )Úutilc                   @   s   e Zd ZdS )ÚErrorN©Ú__name__Ú
__module__Ú__qualname__© r   r   ú4/tmp/pip-unpacked-wheel-b9et7o5g/streamlit/errors.pyr      s   r   c                   @   s   e Zd ZdS )ÚDeprecationErrorNr   r   r   r   r	   r
      s   r
   c                   @   s   e Zd ZdS )ÚNoStaticFilesNr   r   r   r   r	   r      s   r   c                   @   s   e Zd ZdS )ÚNoSessionContextNr   r   r   r   r	   r      s   r   c                   @   s   e Zd ZdZdS )ÚMarkdownFormattedExceptionz©Exceptions with Markdown in their description.

    Instances of this class can use markdown in their messages, which will get
    nicely formatted on the frontend.
    N)r   r   r   Ú__doc__r   r   r   r	   r   "   s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚUncaughtAppExceptionzSCatchall exception type for uncaught exceptions that occur during script execution.c                 C   s
   || _ d S ©N)Úexc)Úselfr   r   r   r	   Ú__init__/   s    zUncaughtAppException.__init__N)r   r   r   r   r   r   r   r   r	   r   ,   s   r   c                   @   s   e Zd ZdZedœdd„ZdS )ÚStreamlitAPIExceptionaä  Base class for Streamlit API exceptions.

    An API exception should be thrown when user code interacts with the
    Streamlit API incorrectly. (That is, when we throw an exception as a
    result of a user's malformed `st.foo` call, it should be a
    StreamlitAPIException or subclass.)

    When displaying these exceptions on the frontend, we strip Streamlit
    entries from the stack trace so that the user doesn't see a bunch of
    noise related to Streamlit internals.

    ©Úreturnc                 C   s
   t  | ¡S r   ©r   Úrepr_©r   r   r   r	   Ú__repr__A   s    zStreamlitAPIException.__repr__N)r   r   r   r   Ústrr   r   r   r   r	   r   3   s   r   c                   @   s   e Zd ZdS )ÚDuplicateWidgetIDNr   r   r   r   r	   r   E   s   r   c                   @   s   e Zd ZdS )ÚUnserializableSessionStateErrorNr   r   r   r   r	   r   I   s   r   c                       s.   e Zd ZdZ‡ fdd„Zedœdd„Z‡  ZS )ÚStreamlitAPIWarningúsUsed to display a warning.

    Note that this should not be "raised", but passed to st.exception
    instead.
    c                    s8   t t| ƒj|Ž  dd l}dd l}| ¡ }| |¡| _d S )Nr   )Úsuperr   r   ÚinspectÚ	tracebackÚcurrentframeÚextract_stackZtacked_on_stack)r   Úargsr!   r"   Úf©Ú	__class__r   r	   r   T   s
    zStreamlitAPIWarning.__init__r   c                 C   s
   t  | ¡S r   r   r   r   r   r	   r   \   s    zStreamlitAPIWarning.__repr__©r   r   r   r   r   r   r   Ú__classcell__r   r   r'   r	   r   M   s   r   c                       s.   e Zd ZdZ‡ fdd„Zedœdd„Z‡  ZS )ÚStreamlitDeprecationWarningr   c                    s.   d  ||| d¡d ¡}tƒ j|f|žŽ  d S )Nz¸
{0}

You can disable this warning by disabling the config option:
`{1}`

```
st.set_option('{1}', False)
```
or in your `.streamlit/config.toml`
```
[deprecation]
{2} = false
```
    Ú.é   )ÚformatÚsplitr    r   )r   Zconfig_optionÚmsgr%   Úmessager'   r   r	   r   g   s      ñz$StreamlitDeprecationWarning.__init__r   c                 C   s
   t  | ¡S r   r   r   r   r   r	   r   ~   s    z$StreamlitDeprecationWarning.__repr__r)   r   r   r'   r	   r+   `   s   r+   N)Z	streamlitr   Ú	Exceptionr   r
   r   r   r   r   r   r   r   ÚWarningr   r+   r   r   r   r	   Ú<module>   s   
