
    Mh                         d Z ddlm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eee          Zej        xZZdS )JupyterLab Server Application    )glob)relpath)Any)ExtensionAppExtensionAppJinjaMixin)url_path_join)DictIntegerUnicodeobserve   )__version__)	LabConfigadd_handlersc                      e Zd ZdZdZdZdZdZede	fd            Z
 edd	          Zd
Z edd	                              e          Z edd
d          Z edd
d          Z edd
d          Z edd
d          Z edd
d          Z ei d
d          ZdddZ e ee           deddf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/treereturnc                     | j         S )N)nameselfs    U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jupyterlab_server/app.pyapp_namespacezLabServerApp.app_namespace   s
    y    z'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_urischangeNc                    |j         }| j                            |          \  }}t          | |          }||j        k    rK| j                            d| j        j        ||| j        j        |           t          | ||j                   dS dS )zobserver for deprecated traitsz7%s.%s is deprecated in JupyterLab %s, use %s.%s insteadN)
r   _deprecated_aliasesgetgetattrnewlogwarning	__class____name__setattr)r   r&   old_attrnew_attrversion	new_values         r   _deprecated_traitzLabServerApp._deprecated_traitU   s     ; 488BB'D(++	
"" HI''   D(FJ///// #"r   c                 p    t           j                            dg                     }|                     j                    j         j        z   D ]8 fdt           dd          D             }|                    |           9 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           	      V    g | ]%}t          j        t          |                    &S  )ujoinlabextensions_urlr   ).0pathextension_pathr   s     r   
<listcomp>z4LabServerApp.initialize_settings.<locals>.<listcomp>v   s@        d,gdN.K.KLL  r   z
/**/staticT)	recursiveN)
setsettingsr)   addstatic_url_prefixlabextensions_pathextra_labextensions_pathr   updatelist)r   immutable_cacheextensions_urlr>   s   `  @r   initialize_settingsz LabServerApp.initialize_settingsj   s    
 dm//0H"MMNN 	D2333 #58UU 	3 	3N     N!>!>!>$OOO  N
 "">22226_8M8MNOOOOOr   c                 :    | j         g| _        | j        g| _        dS )zInitialize templates.N)
static_dirstatic_pathstemplates_dirtemplate_pathsr   s    r   initialize_templatesz!LabServerApp.initialize_templates   s#    !_-#12r   c                 0    t          | j        |            dS )zInitialize handlers.N)r   handlersr   s    r   initialize_handlersz LabServerApp.initialize_handlers   s    T]D)))))r   )r   N)!r/   
__module____qualname____doc__r   extension_urlapp_namefile_url_prefixpropertystrr   r   default_urlload_other_extensionstagr   app_versionr$   r!   r%   r#   r   listings_refresh_secondsr
   listings_request_optionsr(   r   rH   r   r5   rK   rQ   rT   r9   r   r   r   r      s       ;;DM.H!Os    X '&'PQQQK !'"#DEEEIIR]I^^KW
4V  N &g
	 	 	 W
4V  N &g
	 	 	  'w#W       $t
[      =<  Wdd&''(0 0 0 0 0 )(0(P P P P*3 3 3 3
* * * * * *r   r   N)rW   r   os.pathr   typingr   $jupyter_server.extension.applicationr   r   jupyter_server.utilsr	   r:   	traitletsr
   r   r   r   _versionr   rS   r   r   r   launch_instancemainlaunch_new_instancer9   r   r   <module>rl      s	   # #
                   U U U U U U U U 7 7 7 7 7 7 5 5 5 5 5 5 5 5 5 5 5 5 ! ! ! ! ! ! - - - - - - - -t* t* t* t* t*)9l t* t* t*n *9 9r   