o
    œ©Zhã  ã                   @   s0   d Z ddlmZ ddlmZ G dd„ deƒZdS )zHPayload system for IPython.

Authors:

* Fernando Perez
* Brian Granger
é    )ÚConfigurable)ÚListc                   @   s8   e Zd ZU eg ƒZeed< d
dd„Zdd„ Zdd„ Zd	S )ÚPayloadManagerÚ_payloadTc                 C   sr   t |tƒstd| ƒ‚|r1d|v r1|d }t| jƒD ]\}}d|v r0|d |kr0|| j|<  dS q| j |¡ dS )zÐInclude or update the specified `data` payload in the PayloadManager.

        If a previous payload with the same source exists and `single` is True,
        it will be overwritten with the new one.
        z*Each payload write must be a dict, got: %rÚsourceN)Ú
isinstanceÚdictÚ	TypeErrorÚ	enumerater   Úappend)ÚselfÚdataÚsingler   ÚiÚpl© r   úK/var/www/html/lang_env/lib/python3.10/site-packages/IPython/core/payload.pyÚwrite_payload   s   

€zPayloadManager.write_payloadc                 C   s   | j S ©N©r   ©r   r   r   r   Úread_payload2   s   zPayloadManager.read_payloadc                 C   s
   g | _ d S r   r   r   r   r   r   Úclear_payload5   s   
zPayloadManager.clear_payloadN)T)	Ú__name__Ú
__module__Ú__qualname__r   r   Ú__annotations__r   r   r   r   r   r   r   r      s
   
 
r   N)Ú__doc__Ztraitlets.config.configurabler   Z	traitletsr   r   r   r   r   r   Ú<module>   s   