U ʗReS@sddlZddlmZmZejdkr0ddlmZn ddlmZddlmZddl m Z m Z m Z m Z ddlmZdd lmZmZdd lmZdd lmZed ZGd ddZdS)N)OptionalTuple))Literal) loop_last)ConsoleConsoleOptionsRenderableType RenderResult)Control) ControlTypeSegment) StyleType)Text)cropellipsisvisiblec@sdeZdZdZdeeeddddZeddd d Ze d d d Z e d ddZ e e edddZdS) LiveRenderzCreates a renderable that may be updated. Args: renderable (RenderableType): Any renderable object. style (StyleType, optional): An optional style to apply to the renderable. Defaults to "". rN) renderablestylevertical_overflowreturncCs||_||_||_d|_dS)N)rrr_shape)selfrrrr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/rich/live_render.py__init__szLiveRender.__init__)rrcCs ||_dS)z|Set a new renderable. Args: renderable (RenderableType): Any renderable object, including str. N)r)rrrrrset_renderable'szLiveRender.set_renderable)rcCsJ|jdk rD|j\}}ttjtjdfftjdftjdff|dStS)zGet control codes to move cursor to beginning of live render. Returns: Control: A control instance that may be printed. Nr)rr rCARRIAGE_RETURN ERASE_IN_LINE CURSOR_UPr_heightrrrposition_cursor/s   zLiveRender.position_cursorcCs>|jdk r8|j\}}ttjftjdftjdff|StS)zGet control codes to clear the render and restore the cursor to its previous position. Returns: Control: A Control instance that may be printed. Nrr!)rr rr"r$r#r%rrrrestore_cursorDs  zLiveRender.restore_cursor)consoleoptionsrc cs|j}||j}|j|||dd}t|}|\}}||jjkr|jdkrh|d|jj}t|}nN|jdkr|d|jjd}t ddddd d } | t | | t|}||_ t} t|D]\} } | EdH| s| VqdS) NF)rpadrrrz...centerrz live.ellipsis)overflowjustifyendr)r get_styler render_linesr get_shapesizer'rrappendlistrenderrliner) rr*r+rrlinesshaper&r' overflow_textnew_linelastr8rrr__rich_console__Rs4        zLiveRender.__rich_console__)rr)__name__ __module__ __qualname____doc__r rVerticalOverflowMethodrr r r(r)r r r r>rrrrrs   r)systypingrr version_inforZpip._vendor.typing_extensions_looprr*r r r r controlr segmentrrrrtextrrCrrrrrs