U cfj @sddlmZmZmZmZmZmZer>> print(Padding("Hello", (2, 4), style="on blue")) Args: renderable (RenderableType): String or other renderable. pad (Union[int, Tuple[int]]): Padding for top, right, bottom, and left borders. May be specified with 1, 2, or 4 integers (CSS style). style (Union[str, Style], optional): Style for padding characters. Defaults to "none". expand (bool, optional): Expand padding to fit available width. Defaults to True. rrrrnoneT)styleexpandr PaddingDimensions) renderablepadrrcCs0||_||\|_|_|_|_||_||_dS)N)runpacktoprightbottomleftrr)selfrrrrrF/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/padding.py__init__!szPadding.__init__)rlevelreturncCst|ddd|fddS)zMake padding instance to render an indent. Args: renderable (RenderableType): String or other renderable. level (int): Number of characters to indent. Returns: Padding: A Padding instance. rF)rr)r)clsrr"rrr indent.s zPadding.indent)rr#cCst|tr||||fSt|dkr6|d}||||fSt|dkrdttttf|\}}||||fSt|dkrttttttf|\}}}}||||fStdt|ddS)z&Unpack padding specified in CSS style.rrz)1, 2 or 4 integers required for padding; z givenN) isinstanceintlenrr ValueError)r_padpad_top pad_rightrrrrrrr r<s        zPadding.unpack)r#c Cs.d|jd|jd|jd|jd|jd S)NzPadding(z, (,z)))rrrrr)rrrr __repr__LszPadding.__repr__r r r )consoleoptionsr#c cs||j}|jr|j}n&tt|||jj|j |j |j}| ||j |j }|j dk rz|j |j |j|jd}|j|j||dd}t}|j r|d|j |nd}|j r|d|j ||gn|g} d} |jr|d|d|g} | |jEdH|r6|D] } |V| EdH| EdHqn |D]} | EdH| EdHq:|jr| px|d|d|g} | |jEdHdS)N)heightT)rr  ) get_stylerr max_widthminrgetrmaximumrr update_widthr3 update_heightrr render_linesrline) rr1r2rwidthrender_optionslines_Segmentrr blank_liner>rrr __rich_console__OsV    zPadding.__rich_console__rcCs\|j}|j|j}||dkr(t||St|||j\}}t||||}||}|S)Nr)r7rrrr9r with_maximum)rr1r2r7 extra_width measure_min measure_max measurementrrr __rich_measure__}s    zPadding.__rich_measure__N)r)__name__ __module__ __qualname____doc__rstrrboolr! classmethodr)r% staticmethodrrr0rDrJrrrr rs0    /r__main__)printz Hello, World)r&r'zon blue)rN)typingrrrrrrr1r r r r jupyterr measurerrrsegmentrr)rrrKpip._vendor.richrTrrrr s     (w