o 7]hj"@s>ddlZddlZddlmZddlmZddlmZddlm Z m Z m Z m Z m Z ddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZGdddZdefddZe dkre e!ddZ"eZ#eZ$e"%e#e&ee$ddZ'e!e"_(eZ$e"%e#e&ee$ddZ)e"j(*Z+e+,dD]Z-e%e-ddqe%de'de%de)dddl.m/Z/e Z"ej0ddZ1e1j2dd d!e1j2dd"e13d#d$e13d%d&e13d'd(e4d)Z5ej0d*dZ6e62e6j2dd"e63e5e1e"j%e/j7e6ej8d+d,d-d.d/d0dSdS)1N) process_time)box)Color)ConsoleConsoleOptionsGroupRenderableType RenderResult)Markdown) Measurement)Pretty)Segment)Style)Syntax)Table)Textc@s8eZdZdededefddZdddedefddZd S) ColorBoxconsoleoptionsreturnccstddD]V}t|jD]I}||j}d|dd}t||d\}}} t||dd\} } } t|d|d| d} t| d| d| d}tdt|| d Vq tVqdS) Nrg?gffffff?g?gQ?u▄)colorbgcolor) range max_widthcolorsys hls_to_rgbrfrom_rgbr rline)selfrryxhlr1g1b1r2g2b2rrr+;/usr/lib/python3/dist-packages/pip/_vendor/rich/__main__.py__rich_console__s  zColorBox.__rich_console__rcCs td|jS)N)r r)r rrr+r+r,__rich_measure__!s zColorBox.__rich_measure__N) __name__ __module__ __qualname__rrr r-r r/r+r+r+r,rs rrc Cstjddd}d|_|jddddd|d td d d d d d }|d t|d||ddd}tjddd}d |_|t|dddt|dddt|dddt|ddd|dtt d|dt dt dtfd d!}|d"d#d$}|d%|td dd d&d'gt j d(}|jd)ddd*|jd+dd,|jd-d.ddd/|jd0d1ddd/|d2d3d4d5|d6d7d4d8|d9d:d;d<|d=d>d?d@|dA|dB}dCdDgdEdF}|dG|t |dHdddIt|ddJdK} |dL|dM| t| |dNdO|S)Pz8Get a renderable that demonstrates a number of features.r.T)paddingpad_edgez Rich featuresFeaturecenterzbold red)no_wrapjustifystyle DemonstrationNF)rexpand show_header show_edger4u✓ [bold green]4-bit color[/] ✓ [bold blue]8-bit color[/] ✓ [bold magenta]Truecolor (16.7 million)[/] ✓ [bold yellow]Dumb terminals[/] ✓ [bold cyan]Automatic color conversionColorsStyleszAll 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.)r3collapse_paddingleftgreen)r8r9yellowrightbluefullredrz[Word wrap text. Justify [green]left[/], [yellow]center[/], [blue]right[/] or [red]full[/]. renderable1 renderable2rcSs<tddddd}|jddd|jddd||||S)NFT)r<r4rr;1r.)ratio2)r add_columnadd_row)rHrItabler+r+r, comparison[s  z"make_test_card..comparisonzAsian 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: Markupnonedim)r=r<r; row_stylesrz [green]Date)r9r7z [blue]Title)r9z[cyan]Production Budgetcyan)r9r8r7z[magenta]Box Officemagentaz 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,000zold]$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,677Tablesa~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 AtreideszVladimir Harkonnenz Thufir Hawat)FTN)fooatomicz%Syntax highlighting & pretty printingpython3) 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...)rgridtitlerMrNrr4rr from_markuprrSIMPLErr r ) rO color_tablelorem lorem_tablerPmarkup_example example_tablecode pretty_datamarkdown_exampler+r+r,make_test_card's            ri__main__T)fileforce_terminalg@@r.)endz rendered in zms (cold cache)zms (warm cache))Panel)r3rBrD)r9r8)r7zBuy devs a :coffee:zF[u blue link=https://ko-fi.com/textualize]https://ko-fi.com/textualizeTwitterzL[u blue link=https://twitter.com/willmcgugan]https://twitter.com/willmcguganBlogzD[u blue link=https://www.willmcgugan.com]https://www.willmcgugan.comzWe hope you enjoy using Rich! Rich is maintained with :heart: by [link=https://www.textualize.io]Textualize.io[/] - Will McGugan)r.rrz"[b red]Thanks for trying out Rich! bright_blue)rr3r^ border_styler6)r8)9riotimerpip._vendor.richrpip._vendor.rich.colorrpip._vendor.rich.consolerrrrr pip._vendor.rich.markdownr pip._vendor.rich.measurer pip._vendor.rich.prettyr pip._vendor.rich.segmentr pip._vendor.rich.stylerpip._vendor.rich.syntaxrpip._vendor.rich.tablerpip._vendor.rich.textrrrir0StringIOr test_cardstartprintroundpre_cache_takenrktakengetvaluetext splitlinesrpip._vendor.rich.panelror]sponsor_messagerMrNr_ intro_messagemessagefitROUNDEDr+r+r+r,s            ,