o
    i.                     @   s   d Z ddlmZ ddlmZ ddlmZmZ ddlmZ	 ddl
mZmZmZmZ ddlmZ dd	lmZmZ G d
d deeeZej ZZdS )JupyterLab Server Application    )glob)relpath)ExtensionAppExtensionAppJinjaMixin)url_path_join)DictIntegerUnicodeobserve   )__version__)	LabConfigadd_handlersc                   @   s   e Zd ZdZdZdZdZdZedd Z	e
ddd	Zd
Ze
ddd	jedZe
dd
ddZe
dd
ddZe
dd
ddZe
dd
ddZedd
ddZei d
ddZdddZeee dd Zdd Zdd Zdd  Zd!S )"LabServerAppz1A Lab Server Application that runs out-of-the-boxjupyterlab_serverz/labr   z	/lab/treec                 C   s   | j S )N)nameself r   P/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/jupyterlab_server/app.pyapp_namespace   s   zLabServerApp.app_namespacez'The default URL to redirect to from `/`)helpT zThe version of the application.)defaultz6Deprecated, use `LabServerApp.blocked_extensions_uris`)configr   z
        A list of comma-separated URIs to get the blocked extensions list

        .. versionchanged:: 2.0.0
            `LabServerApp.blacklist_uris` renamed to `blocked_extensions_uris`
        z6Deprecated, use `LabServerApp.allowed_extensions_uris`z
        "A list of comma-separated URIs to get the allowed extensions list

        .. versionchanged:: 2.0.0
            `LabServerApp.whitetlist_uris` renamed to `allowed_extensions_uris`
        i  z2The interval delay in seconds to refresh the listszThe optional kwargs to use for the listings HTTP requests             as described on https://2.python-requests.org/en/v2.7.0/api/#requests.request)blocked_extensions_uris1.2)allowed_extensions_urisr   )blacklist_uriswhitelist_urisc                 C   s^   |j }| j|\}}t| |}||jkr-| jdj| jj	|||d t
| ||j dS dS )zobserver for deprecated traitszJ{cls}.{old} is deprecated in JupyterLab {version}, use {cls}.{new} instead)clsoldnewversionN)r   _deprecated_aliasesgetgetattrr#   logwarningformat	__class____name__setattr)r   changeold_attrnew_attrr$   	new_valuer   r   r   _deprecated_traitT   s   

zLabServerApp._deprecated_traitc                    st   t jdg }|j jj D ]  fddt  dddD }|| qjdt	|i dS )zuInitialize the settings:

        set the static files as immutable, since they should have all hashed name.
        static_immutable_cachec                    s   g | ]}t jt| qS r   )ujoinlabextensions_urlr   ).0pathextension_pathr   r   r   
<listcomp>t   s    z4LabServerApp.initialize_settings.<locals>.<listcomp>z
/**/staticT)	recursiveN)
setsettingsr&   addstatic_url_prefixlabextensions_pathextra_labextensions_pathr   updatelist)r   immutable_cacheextensions_urlr   r8   r   initialize_settingsh   s   z LabServerApp.initialize_settingsc                 C   s   | j g| _| jg| _dS )zInitialize templates.N)
static_dirstatic_pathstemplates_dirtemplate_pathsr   r   r   r   initialize_templates}   s   
z!LabServerApp.initialize_templatesc                 C   s   t | j|  dS )zInitialize handlers.N)r   handlersr   r   r   r   initialize_handlers   s   z LabServerApp.initialize_handlersN)r,   
__module____qualname____doc__r   extension_urlapp_namefile_url_prefixpropertyr   r
   default_urlload_other_extensionstagr   app_versionr   r   r    r   r	   listings_refresh_secondsr   listings_request_optionsr%   r   rC   r2   rF   rK   rM   r   r   r   r   r      sV    


r   N)rP   r   os.pathr   $jupyter_server.extension.applicationr   r   jupyter_server.utilsr   r4   	traitletsr   r	   r
   r   _versionr   rL   r   r   r   launch_instancemainlaunch_new_instancer   r   r   r   <module>   s    v