a
    hbòfj"  ã                   @   s<  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	m
Z
mZmZmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ G dd„ dƒZedœdd„Ze dk�r8e	e !¡ dd�Z"eƒ Z#eƒ Z$e" %e#¡ e&eƒ e$ d dƒZ'e !¡ e"_(eƒ Z$e" %e#¡ e&eƒ e$ d dƒZ)e"j( *¡ Z+e+ ,d¡D ]Z-e%e-dd� �qRe%de'› d�ƒ e%de)› d�ƒ d dl.m/Z/ e	ƒ Z"ej0dd�Z1e1j2dd d!� e1j2dd"� e1 3d#d$¡ e1 3d%d&¡ e1 3d'd(¡ e 4d)¡Z5ej0d*d�Z6e6 2¡  e6j2dd"� e6 3e5e1¡ e"j%e/j7e6ej8d+d,d-d.�d/d0� dS )1é    N)Úprocess_time)Úbox)ÚColor)ÚConsoleÚConsoleOptionsÚGroupÚRenderableTypeÚRenderResult)ÚMarkdown)ÚMeasurement)ÚPretty)ÚSegment)ÚStyle)ÚSyntax)ÚTable)ÚTextc                   @   s0   e Zd Zeeedœdd„Zdeedœdd„ZdS )ÚColorBox)ÚconsoleÚoptionsÚreturnc                 c   s¼   t ddƒD ]¬}t |jƒD ]’}||j }d|d d  }t ||d¡\}}}	t ||d d¡\}
}}t |d |d |	d ¡}t |
d |d |d ¡}tdt||d	�ƒV  qt ¡ V  q
d S )
Nr   é   gš™™™™™¹?gffffffæ?g      ð?gëQ¸…ë±?éÿ   u   â–„)ÚcolorÚbgcolor)	ÚrangeÚ	max_widthÚcolorsysÚ
hls_to_rgbr   Úfrom_rgbr   r   Úline)Úselfr   r   ÚyÚxÚhÚlÚr1Úg1Úb1Úr2Úg2Úb2r   r   © r+   úV/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/pip/_vendor/rich/__main__.pyÚ__rich_console__   s    
zColorBox.__rich_console__r   c                 C   s   t d|jƒS )Né   )r   r   )r    r   r   r+   r+   r,   Ú__rich_measure__!   s    zColorBox.__rich_measure__N)	Ú__name__Ú
__module__Ú__qualname__r   r   r	   r-   r   r/   r+   r+   r+   r,   r      s   þþr   )r   c            
   
   C   s
  t jddd�} d| _| jddddd� |  d	¡ t d
ddddd�}| dtƒ ¡ |  d|¡ |  dd¡ d}t jddd�}d|_| t|ddd�t|ddd�t|ddd�t|ddd�¡ |  dtt 	d¡|ƒ¡ t
t
t dœdd„}|  d d!¡ d"}|  d#|¡ t dddd$d%gtjd&�}|jd'ddd(� |jd)dd*� |jd+d,ddd-� |jd.d/ddd-� | d0d1d2d3¡ | d4d5d2d6¡ | d7d8d9d:¡ | d;d<d=d>¡ |  d?|¡ d@}dAdBgdCdDœ}|  dE|t|dFdddG�t|ddH�ƒ¡ dI}	|  dJ|dK|	 t|	ƒƒ¡ |  dLdM¡ | S )Nz8Get a renderable that demonstrates a number of features.r.   T)ÚpaddingÚpad_edgezRich featuresZFeatureÚcenterzbold red)Úno_wrapÚjustifyÚstyleZDemonstrationNF)r   ÚexpandÚshow_headerÚ	show_edger4   u·   âœ“ [bold green]4-bit color[/]
âœ“ [bold blue]8-bit color[/]
âœ“ [bold magenta]Truecolor (16.7 million)[/]
âœ“ [bold yellow]Dumb terminals[/]
âœ“ [bold cyan]Automatic color conversionZColorsZStylesz§All ansi styles: [bold]bold[/], [dim]dim[/], [italic]italic[/italic], [underline]underline[/], [strike]strikethrough[/], [reverse]reverse[/], and even [blink]blink[/].z›Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at justo. Maecenas luctus velit et auctor maximus.)r3   Úcollapse_paddingÚleftÚgreen)r7   r8   ÚyellowÚrightÚblueÚfullÚredr   z[Word wrap text. Justify [green]left[/], [yellow]center[/], [blue]right[/] or [red]full[/].
)Úrenderable1Úrenderable2r   c                 S   s<   t ddd dd�}|jddd� |jddd� | | |¡ |S )NFT)r:   r4   r   r9   Ú1r.   )ÚratioÚ2)r   Ú
add_columnÚadd_row)rD   rE   Útabler+   r+   r,   Ú
comparison[   s
    z"make_test_card.<locals>.comparisonzAsian
language
supportu!  :flag_for_china:  è¯¥åº“æ”¯æŒ�ä¸­æ–‡ï¼Œæ—¥æ–‡å’ŒéŸ©æ–‡æ–‡æœ¬ï¼�
:flag_for_japan:  ãƒ©ã‚¤ãƒ–ãƒ©ãƒªã�¯ä¸­å›½èªžã€�æ—¥æœ¬èªžã€�éŸ“å›½èªžã�®ãƒ†ã‚­ã‚¹ãƒˆã‚’ã‚µãƒ�ãƒ¼ãƒˆã�—ã�¦ã�„ã�¾ã�™
:flag_for_south_korea:  ì�´ ë�¼ì�´ë¸ŒëŸ¬ë¦¬ëŠ” ì¤‘êµ­ì–´, ì�¼ë³¸ì–´ ë°� í•œêµ­ì–´ í…�ìŠ¤íŠ¸ë¥¼ ì§€ì›�í•©ë‹ˆë‹¤z°[bold magenta]Rich[/] supports a simple [i]bbcode[/i]-like [b]markup[/b] for [yellow]color[/], [underline]style[/], and emoji! :+1: :apple: :ant: :bear: :baguette_bread: :bus: ZMarkupÚnoneÚdim)r;   r:   r9   Ú
row_stylesr   z[green]Date)r8   r6   z[blue]Title)r8   z[cyan]Production BudgetÚcyan)r8   r7   r6   z[magenta]Box OfficeÚmagentazDec 20, 2019z Star Wars: The Rise of Skywalkerz$275,000,000z$375,126,118zMay 25, 2018z[b]Solo[/]: A Star Wars Storyz$393,151,347zDec 15, 2017z!Star Wars Ep. VIII: The Last Jediz$262,000,000z[bold]$1,332,539,889[/bold]zMay 19, 1999z-Star Wars Ep. [b]I[/b]: [i]The phantom Menacez$115,000,000z$1,027,044,677ZTablesa~  def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
    """Iterate and generate a tuple with a flag for last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    for value in iter_values:
        yield False, previous_value
        previous_value = value
    yield True, previous_valuegÉå?$	@)zPaul AtreideszVladimir HarkonnenzThufir Hawat)FTN)ZfooZatomicz%Syntax
highlighting
&
pretty
printingÚpython3)Úline_numbersÚindent_guides)rT   zš# Markdown

Supports much of the *markdown* __syntax__!

- Headers
- Basic formatting: **bold**, *italic*, `code`
- Block quotes
- Lists, and more...
    r
   z[cyan]z+more!zBProgress bars, columns, styled logging handler, tracebacks, etc...)r   ÚgridÚtitlerI   rJ   r   r4   r   r   Úfrom_markupr   r   ÚSIMPLEr   r   r
   )
rK   Zcolor_tableZloremZlorem_tablerL   Zmarkup_exampleZexample_tableÚcodeZpretty_dataZmarkdown_exampler+   r+   r,   Úmake_test_card'   sä    
û÷þüÿüþ
þÿûüüüüüüþ÷
þþ
ÿþrZ   Ú__main__T)ÚfileÚforce_terminalg     @�@r.   Ú )Úendzrendered in zms (cold cache)zms (warm cache))ÚPanel)r3   r>   r@   )r8   r7   )r6   zBuy devs a :coffee:zF[u blue link=https://ko-fi.com/textualize]https://ko-fi.com/textualizeZTwitterzL[u blue link=https://twitter.com/willmcgugan]https://twitter.com/willmcguganZBlogzD[u blue link=https://www.willmcgugan.com]https://www.willmcgugan.comz‚We hope you enjoy using Rich!

Rich is maintained with :heart: by [link=https://www.textualize.io]Textualize.io[/]

- Will McGugané   )r.   ra   z"[b red]Thanks for trying out Rich!Úbright_blue)r   r3   rV   Úborder_styler5   )r7   )9r   ÚioÚtimer   Úpip._vendor.richr   Úpip._vendor.rich.colorr   Úpip._vendor.rich.consoler   r   r   r   r	   Zpip._vendor.rich.markdownr
   Zpip._vendor.rich.measurer   Úpip._vendor.rich.prettyr   Zpip._vendor.rich.segmentr   Úpip._vendor.rich.styler   Zpip._vendor.rich.syntaxr   Úpip._vendor.rich.tabler   Úpip._vendor.rich.textr   r   rZ   r0   ÚStringIOr   Z	test_cardÚstartÚprintÚroundZpre_cache_takenr\   ZtakenÚgetvalueÚtextÚ
splitlinesr   Zpip._vendor.rich.panelr`   rU   Zsponsor_messagerI   rJ   rW   Zintro_messageÚmessageÚfitÚROUNDEDr+   r+   r+   r,   Ú<module>   s†    ,
þ



þþÿÿ	ûø