
    \.i                     2   d dl mZ d dlmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZmZ erdd	lmZmZ d
ddd
d
d
d
ddddee   dededee   dee   dee   ded   ddfdZedk(  r(d dlmZ  e        dededd
fdZ ed d!        e        y
y
)"    )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scopezMapping[str, Any]r   r   r   r   r   r   r   r   returnr   c                   t               }t        j                  dd      }	|	j                  d       dt        t
        t        f   dt        t        t
        f   fd}
|rt        | j                         |
	      n| j                         }|D ]R  \  }}t        j                  ||j                  d
      rdndfd      }|	j                  |t        |||||||             T t        j                   |	|dd      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)justifyitemr   c                 P    | \  }}|j                  d       |j                         fS )z2Sort special variables first, then alphabetically.__)
startswithlower)r   key_s      F/mnt/e/genesis-system/.venv/lib/python3.12/site-packages/rich/scope.py
sort_itemsz render_scope.<locals>.sort_items-   s(    QNN4((#))+66    )r$   r!   zscope.key.specialz	scope.key)z =zscope.equals)highlighterr   r   r   r   r   zscope.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   r   r)   items_tabler'   r0   r$   valuekey_texts                  r&   render_scoper7      s    6 "#K**VE:K7+7sCx 7U49-= 7
 6?F5;;=j1EKKME 

U==)=%;O"
 	'+%%#!	

" 99#	 r(   __main__)printfoobarc                 `    g d}ddg ddgdd}t        t        t               dd	
             y )N)r         N   TFzHello Worldz1.1confirmFruitPurchase)appleorangemangoespomelog+?	194521489)versionmethodparamsidz	[i]localsF)r   r   )r9   r7   locals)r:   r;   list_of_thingsdict_of_thingss       r&   testrM   Q   s4    G,?G	
 	l68;%HIr(   gk	W4@g?$	@)collections.abcr   typingr   r   r   r   r)   r	   panelr
   prettyr   tabler   textr   r   consoler   r   r.   intr7   __name__richr9   floatrM    r(   r&   <module>rZ      s    # 6 6 (     : !% $ $#+/;; H; 	;
 ; ; ; }; '(; ;| z	GJ% Je J J 	&	G! r(   