
    &e                     >    d Z ddlmZ ddlmZ  G d de          ZdS )zHPayload system for IPython.

Authors:

* Fernando Perez
* Brian Granger
    )Configurable)Listc                   8    e Zd Z eg           ZddZd Zd ZdS )PayloadManagerTc                    t          |t                    st          d|z            |rCd|v r?|d         }t          | j                  D ]"\  }}d|v r|d         |k    r|| j        |<    dS #| j                            |           dS )zInclude 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	enumerate_payloadappend)selfdatasingler   ipls         4lib/python3.11/site-packages/IPython/core/payload.pywrite_payloadzPayloadManager.write_payload    s     $%% 	QH4OPPP 	h$&&(^F"4=11  2r>>blf&<&<'+DM!$FFT"""""    c                     | j         S Nr   r   s    r   read_payloadzPayloadManager.read_payload3   s
    }r   c                     g | _         d S r   r   r   s    r   clear_payloadzPayloadManager.clear_payload6   s    r   N)T)__name__
__module____qualname__r   r   r   r   r    r   r   r   r      sS        tBxxH# # # #&      r   r   N)__doc__traitlets.config.configurabler   	traitletsr   r   r!   r   r   <module>r%      si    & 7 6 6 6 6 6          \     r   