HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_vendor/rich/__pycache__/jupyter.cpython-37.pyc
B

L��g��@s�ddlmZmZmZmZmZmZer0ddlmZddl	m
Z
ddlmZddl
mZerdddlmZdZGdd	�d	�ZGd
d�d�Zeeed�d
d�Zeeedd�dd�Zeedd�dd�ZdS)�)�
TYPE_CHECKING�Any�Dict�Iterable�List�Sequence)�ConsoleRenderable�)�get_console)�Segment)�DEFAULT_TERMINAL_THEMEz�<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
c@sFeZdZdZeedd�dd�Zeeeeeeeefd�dd�Z	dS)	�JupyterRenderablez)A shim to write html to Jupyter notebook.N)�html�text�returncCs||_||_dS)N)rr)�selfrr�r�</tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/rich/jupyter.py�__init__szJupyterRenderable.__init__)�include�exclude�kwargsrcsF|j|jd�}�r(�fdd�|��D�}�rB�fdd�|��D�}|S)N)z
text/plainz	text/htmlcsi|]\}}|�kr||�qSrr)�.0�k�v)rrr�
<dictcomp>sz7JupyterRenderable._repr_mimebundle_.<locals>.<dictcomp>csi|]\}}|�kr||�qSrr)rrr)rrrr s)rr�items)rrrr�datar)rrr�_repr_mimebundle_sz#JupyterRenderable._repr_mimebundle_)
�__name__�
__module__�__qualname__�__doc__�strrrrrrrrrrr
sr
c@s:eZdZdZdZdeeeeeeeefd�dd�Z	dS)�JupyterMixinz@Add to an Rich renderable to make it render in Jupyter notebook.rr)rrrrrc	slt�}t|�||j��}t|�}|�|�}||d�}�rN�fdd�|��D�}�rh�fdd�|��D�}|S)N)z
text/plainz	text/htmlcsi|]\}}|�kr||�qSrr)rrr)rrrr5sz2JupyterMixin._repr_mimebundle_.<locals>.<dictcomp>csi|]\}}|�kr||�qSrr)rrr)rrrr7s)r
�list�render�options�_render_segmentsZ_render_bufferr)	rrrr�console�segmentsrrrr)rrrr)s

zJupyterMixin._repr_mimebundle_N)
rr r!r"�	__slots__rr#rrrrrrrr$$sr$)r*rcCs�ttd�dd�}g}|j}t}xpt�|�D]b\}}}|r:q*||�}|r�|�|�}|rfd|�d|�d�n|}|jr�d|j�d|�d	�}||�q*Wd
�|�}	tj	|	d�}
|
S)N)rrcSs|�dd��dd��dd�S)zEscape html.�&z&amp;�<z&lt;�>z&gt;)�replace)rrrr�escape<sz _render_segments.<locals>.escapez
<span style="z">z</span>z	<a href="z" target="_blank">z</a>�)�code)
r#�appendrrZsimplifyZget_html_style�link�join�JUPYTER_HTML_FORMAT�format)r*r0�	fragmentsZappend_fragmentZthemer�style�controlZruler2rrrrr(;s"

r(N)r*rrcCsDt|�}t||�}yddlm}||�Wntk
r>YnXdS)zRender segments to Jupyter.r)�displayN)r(r
ZIPython.displayr;�ModuleNotFoundError)r*rrZjupyter_renderableZipython_displayrrrr;Ts
r;)�argsrrcOst�}|j||�S)zProxy for Console print.)r
�print)r=rr)rrrr>bsr>)�typingrrrrrrZpip._vendor.rich.consolerr1r
�segmentrZterminal_themerr6r
r$r#r(r;r>rrrr�<module>s