o
     hH                     @   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defddZe dkrd dl!m"Z" e	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	ddZ,e,'e% e	 Z$e$'de) d e$'de+ d e$'  e$'e"j-dddd  dS dS )!    N)process_time)box)Color)ConsoleConsoleOptionsGroupRenderableTypeRenderResult)Markdown)Measurement)Pretty)Segment)Style)Syntax)Table)Textc                   @   s8   e Zd ZdededefddZdddedefddZd	S )
ColorBoxconsoleoptionsreturnc                 c   s    t ddD ]V}t |jD ]I}||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      ?gQ?   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+   O/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/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| dt
dt
dt f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d0d1ddd/ |d2d3d4d5 |d6d7d4d8 |d9d:d;d< |d=d>d?d@ | dA| dB}dCdDgdEdF}| dG|t|dHdddIt|ddJ dK}	| dL|dM|	 t|	 | dNdO | S )Pz8Get a renderable that demonstrates a number of features.r.   T)paddingpad_edgezRich featuresFeaturecenterzbold red)no_wrapjustifystyle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 conversionColorsStyleszAll ansi styles: [bold]bold[/], [dim]dim[/], [italic]italic[/italic], [underline]underline[/], [strike]strikethrough[/], [reverse]reverse[/], and even [blink]blink[/].zLorem 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)r8   r9   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   r;   1r.   )ratio2)r   
add_columnadd_row)rH   rI   tabler+   r+   r,   
comparisonZ   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: Markupnonedim)r=   r<   r;   
row_stylesr   z[green]Date)r9   r7   z[blue]Title)r9   z[cyan]Production Budgetcyan)r9   r8   r7   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,677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)fooatomicz%Syntax
highlighting
&
pretty
printingpython3)line_numbersindent_guides)r\   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titlerM   rN   r   r4   r   r   from_markupr   r   SIMPLEr   r   r
   )
rO   color_tableloremlorem_tablerP   markup_exampleexample_tablecodepretty_datamarkdown_exampler+   r+   r,   make_test_card'   s   



ri   __main__)PanelT)fileforce_terminalg     @@r.   )recordz[dim]rendered in [not dim]zms[/] (cold cache)zms[/] (warm cache)u   [b magenta]Hope you enjoy using Rich![/]

Please consider sponsoring me if you get value from my work.

Even the price of a ☕ can brighten my day!

https://github.com/sponsors/willmcguganrG   zHelp ensure Rich is maintained)border_styler^   ).r   iotimer   richr   
rich.colorr   rich.consoler   r   r   r   r	   rich.markdownr
   rich.measurer   rich.prettyr   rich.segmentr   
rich.styler   rich.syntaxr   
rich.tabler   	rich.textr   r   ri   r0   
rich.panelrk   StringIOr   	test_cardstartprintroundpre_cache_takenrl   takencfitr+   r+   r+   r,   <module>   sZ     +




