o
    º¼tf³  ã                   @   sŠ   d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ G d	d
„ d
eeƒZG dd„ deeƒZG dd„ deeƒZdS )z9 Defines a KernelClient that provides signals and slots.
é    )Ú	HBChannel)ÚThreadedKernelClientÚThreadedZMQSocketChannel)ÚQtCore)ÚTypeé   )ÚQtKernelClientMixin)ÚSuperQObjectc                   @   s"   e Zd ZdZe e¡Zdd„ ZdS )ÚQtHBChannelg      @c                 C   ó   | j  |¡ dS )zD Reimplemented to emit signals instead of making callbacks.
        N)Úkernel_diedÚemit)ÚselfZsince_last_heartbeat© r   úY/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/qtconsole/client.pyÚcall_handlers   s   zQtHBChannel.call_handlersN)	Ú__name__Ú
__module__Ú__qualname__Ztime_to_deadr   ÚSignalÚobjectr   r   r   r   r   r   r
      s    
r
   c                   @   s2   e Zd ZdZe e¡Zdd„ Zdd„ Z	dd„ Z
dS )	ÚQtZMQSocketChannelz=A ZMQ socket emitting a Qt signal when a message is received.c                 C   s   t j ¡  ¡  dS )z) Process any pending GUI events.
        N)r   ZQCoreApplicationÚinstanceZprocessEvents©r   r   r   r   Úprocess_events!   s   z!QtZMQSocketChannel.process_eventsc                 C   r   )a  This method is called in the ioloop thread when a message arrives.

        It is important to remember that this method is called in the thread
        so that some logic must be done to ensure that the application level
        handlers are called in the application thread.
        N)Úmessage_receivedr   )r   Úmsgr   r   r   r   &   s   z QtZMQSocketChannel.call_handlersc                 C   s   | j du p	| j  ¡ S )zCheck if the channel is closed.N)ÚstreamÚclosedr   r   r   r   r   0   s   zQtZMQSocketChannel.closedN)r   r   r   Ú__doc__r   r   r   r   r   r   r   r   r   r   r   r      s    

r   c                   @   s0   e Zd ZdZeeƒZeeƒZeeƒZee	ƒZ
dS )ÚQtKernelClientz5 A KernelClient that provides signals and slots.
    N)r   r   r   r   r   r   Ziopub_channel_classZshell_channel_classZstdin_channel_classr
   Zhb_channel_classr   r   r   r   r    5   s    r    N)r   Zjupyter_client.channelsr   Zjupyter_client.threadedr   r   Zqtpyr   Z	traitletsr   Zkernel_mixinsr   Úutilr	   r
   r   r    r   r   r   r   Ú<module>   s    