U cf@sXddlmZmZddlmZddlmZerDddlmZm Z m Z m Z GdddeZ dS) )Optional TYPE_CHECKING) JupyterMixin) Measurement)ConsoleConsoleOptionsRenderableType RenderResultc@sLeZdZdZddeeddddZdd d d d d Zdd dd ddZdS) ConstrainzConstrain the width of a renderable to a given number of characters. Args: renderable (RenderableType): A renderable object. width (int, optional): The maximum width (in characters) to render. Defaults to 80. Pr N) renderablewidthreturncCs||_||_dSN)r r)selfr rrH/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/constrain.py__init__szConstrain.__init__rrr )consoleoptionsrccs@|jdkr|jVn(|t|j|j}||j|EdHdSr)rr update_widthmin max_widthrender)rrr child_optionsrrr__rich_console__s  zConstrain.__rich_console__rcCs*|jdk r||j}t|||j}|Sr)rrrgetr )rrr measurementrrr__rich_measure__s  zConstrain.__rich_measure__)r ) __name__ __module__ __qualname____doc__rintrrrrrrrr s r N) typingrrjupyterrmeasurerrrrr r r rrrrs