File: //opt/saltstack/salt/lib/python3.10/site-packages/rich/__pycache__/scope.cpython-310.pyc
o
;j� � @ s d dl mZ d dlmZmZmZmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZ er<dd lmZmZ d
ddd
d
d
d
d
�dddee dededee dee dee ded ddfdd�Zedkr�d dlmZ e� dededd
fd d!�Zed"d#� e� d
S d
S )$� )�Mapping)�
TYPE_CHECKING�Any�Optional�Tuple� )�ReprHighlighter)�Panel)�Pretty)�Table)�Text�TextType)�ConsoleRenderable�OverflowMethodNTF)�title� sort_keys�
indent_guides�
max_length�
max_string� max_depth�overflow�scopezMapping[str, Any]r r r r r r r r �returnr c
C s� t � }tjddd�} | jdd� dtttf dtttf fdd �}
|r+t| � � |
d
�n| � � }|D ]"\}}
t
�||�d�r?dnd
fd�}| �
|t|
||||||d�� q1tj| |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.
max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None.
overflow (OverflowMethod, optional): How to handle overflowing locals, or None to disable. Defaults to None.
Returns:
ConsoleRenderable: A renderable object.
)r r F)�padding�expand�right)Zjustify�itemr c S s | \}}|� d� |�� fS )z2Sort special variables first, then alphabetically.�__)�
startswith�lower)r �key�_� r"