
    XhD                     v    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mZ dZ G d	 d
e      Zde	z  efgZy)z(Tornado handlers for viewing HTML files.    )ensure_async)web)
authorized   )JupyterHandler
path_regex)
url_escapeurl_path_joincontentsc                   B    e Zd ZdZeZej                  ed               Z	y)ViewHandlerz#Render HTML files within an iframe.c                 l  K   |j                  d      }t        | j                  j                  |             d{   st	        j
                  dd|z        |j                  dd      d   }t        | j                  dt        |            }| j                  | j                  d||	             y7 vw)
zGet a view on a given path./Ni  zFile does not exist: %s   filesz	view.html)file_url
page_title)stripr   contents_managerfile_existsr   	HTTPErrorrsplitr
   base_urlr	   writerender_template)selfpathbasenamer   s       P/var/www/html/myenv/lib/python3.12/site-packages/jupyter_server/view/handlers.pygetzViewHandler.get   s      zz#!$"7"7"C"CD"IJJJ--%>%EFF;;sA&r* D9IJ

4''hS['\] Ks   9B4B2A7B4N)
__name__
__module____qualname____doc__AUTH_RESOURCEauth_resourcer   authenticatedr   r!        r    r   r      s,    -!M^  ^r*   r   z/view%sN)r%   jupyter_core.utilsr   tornador   jupyter_server.auth.decoratorr   base.handlersr   r   utilsr	   r
   r&   r   default_handlersr)   r*   r    <module>r1      sC    . ,  4 6 -^. ^& *k* r*   