관리-도구
편집 파일: scope.cpython-38.pyc
U &?�f � @ s� d dl mZ d dlmZmZmZmZ ddlmZ ddl m Z ddlmZ ddl mZ ddlmZmZ ertdd lmZ d ddd d d �dee eeee ee dd�dd�Zedkr�d dlmZ e� eed d�dd�Zedd� e� d S )� )�Mapping)� TYPE_CHECKING�Any�Optional�Tuple� )�ReprHighlighter)�Panel)�Pretty)�Table)�Text�TextType)�ConsoleRenderableNTF)�title� sort_keys� indent_guides� max_length� max_stringzMapping[str, Any]r )�scoper r r r r �returnc C s� t � }tjddd�}|jdd� tttf tttf d�dd�}|rTt| � � |d �n| � � } | D ]@\} }t �| | �d �r|dndfd �}|� |t|||||d�� q`tj||ddd�S )a� Render python variables in a given scope. Args: scope (Mapping): A mapping containing variable names and values. title (str, optional): Optional title. Defaults to None. sort_keys (bool, optional): Enable sorting of items. Defaults to True. indent_guides (bool, optional): Enable indentation guides. Defaults to False. max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to None. max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None. Returns: ConsoleRenderable: A renderable object. )r r F)�padding�expand�right)�justify)�itemr c S s | \}}|� d� |�� fS )z2Sort special variables first, then alphabetically.�__)� startswith�lower)r �key�_� r �D/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/scope.py� sort_items) s z render_scope.<locals>.sort_items)r r zscope.key.specialz scope.key)z =zscope.equals)�highlighterr r r zscope.border)r �border_styler )r r �grid� add_columnr �strr �bool�sorted�itemsr �assembler �add_rowr r �fit) r r r r r r r# �items_tabler"