a
    «ˆc‹  ã                   @   s‚   d Z ddlmZmZmZ ddlZddlZddlZddlZddl	m
Z
 ddl	mZ ddlmZ ddlmZ daG dd	„ d	e
jƒZdS )
zXwslink is a module that extends any
wslink related classes for the purposes of vtkWeb.

é    )Úabsolute_importÚdivisionÚprint_functionN)Ú	websocket)Úregister)Ú	protocols)ÚvtkWebApplicationc                   @   s@   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dS )ÚServerProtocolaN  
    Defines the core server protocol for vtkWeb. Adds support to
    marshall/unmarshall RPC callbacks that involve ServerManager proxies as
    arguments or return values.

    Applications typically don't use this class directly, but instead
    sub-class it and call self.registerVtkWebProtocol() with useful vtkWebProtocols.
    c                 C   s*   t  d¡ |  d|  ¡ ¡ tj | ¡ d S )NzCreating SPÚapp)ÚloggingÚinfoÚsetSharedObjectÚinitApplicationr   r	   Ú__init__©Úself© r   úX/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/vtkmodules/web/wslink.pyr   %   s    
zServerProtocol.__init__c                 C   s   t s
tƒ a t S )z{
        Let subclass optionally initialize a custom application in lieu
        of the default vtkWebApplication.
        )Úapplicationr   r   r   r   r   r   *   s    zServerProtocol.initApplicationc                 C   s   |   d|¡ d S ©Nr
   )r   )r   r   r   r   r   ÚsetApplication4   s    zServerProtocol.setApplicationc                 C   s
   |   d¡S r   )ZgetSharedObjectr   r   r   r   ÚgetApplication7   s    zServerProtocol.getApplicationc                 C   s   |   |¡ d S ©N)ZregisterLinkProtocol)r   Úprotocolr   r   r   ÚregisterVtkWebProtocol:   s    z%ServerProtocol.registerVtkWebProtocolc                 C   s   |   ¡ S r   )ZgetLinkProtocolsr   r   r   r   ÚgetVtkWebProtocols=   s    z!ServerProtocol.getVtkWebProtocolsN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   r	      s   	
r	   )r   Ú
__future__r   r   r   ÚjsonÚbase64r   ÚtimeZwslinkr   r   Z	exportRpcZvtkmodules.webr   Zvtkmodules.vtkWebCorer   r   r	   r   r   r   r   Ú<module>   s    	