
    i
                         d Z ddlmZ ddlmZ ddlmZ ddlZ G d de          Z G d d	e          Z G d
 dej	                  Z
 G d de
          ZdS )z:Semantic text objects that are used for styled outputting.    )absolute_import)division)unicode_literalsNc                   \    e Zd ZdZddZed             Zed             Zed             ZdS )TextAttributesz%Attributes to use to style text with.Nc                 4    || _         || _        |pg | _        dS )a?  Defines a set of attributes for a piece of text.

    Args:
      format_str: (str), string that will be used to format the text
        with. For example '[{}]', to enclose text in brackets.
      color: (Colors), the color the text should be formatted with.
      attrs: (Attrs), the attributes to apply to text.
    N)_format_str_color_attrs)self
format_strcolorattrss       X/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/fire/console/text.py__init__zTextAttributes.__init__   s"     "DDK+2DKKK    c                     | j         S N)r	   r   s    r   r   zTextAttributes.format_str(   s    r   c                     | j         S r   )r
   r   s    r   r   zTextAttributes.color,   
    ;r   c                     | j         S r   )r   r   s    r   r   zTextAttributes.attrs0   r   r   )NNN)	__name__
__module____qualname____doc__r   propertyr   r   r    r   r   r   r      s        --      8   8   8  r   r   c                   ,    e Zd ZdZddZd Zd Zd ZdS )	TypedTextz8Text with a semantic type that will be used for styling.Nc                 "    || _         || _        dS )a  String of text and a corresponding type to use to style that text.

    Args:
     texts: (list[str]), list of strs or TypedText objects
       that should be styled using text_type.
     text_type: (TextTypes), the semantic type of the text that
       will be used to style text.
    N)texts	text_type)r   r"   r#   s      r   r   zTypedText.__init__8   s     DJDNNNr   c                 B    d}| j         D ]}|t          |          z  }|S )Nr   )r"   len)r   lengthtexts      r   __len__zTypedText.__len__D   s/    F
  D		ffMr   c                 (    | |g}t          |          S r   r    r   otherr"   s      r   __add__zTypedText.__add__J   s    5MEUr   c                 (    || g}t          |          S r   r*   r+   s      r   __radd__zTypedText.__radd__N   s    DMEUr   r   )r   r   r   r   r   r(   r-   r/   r   r   r   r    r    5   s[        @@
 
 
 
        r   r    c                       e Zd ZdZd ZdS )
_TextTypesz6Text types base class that defines base functionality.c                 <    t          t          |          |           S )z,Returns a TypedText object using this style.)r    list)r   argss     r   __call__z_TextTypes.__call__V   s    T$ZZ&&&r   N)r   r   r   r   r5   r   r   r   r1   r1   S   s)        >>' ' ' ' 'r   r1   c                   6    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdS )	TextTypesz5Defines text types that can be used for styling text.                        	   N)r   r   r   r   RESOURCE_NAMEURL
USER_INPUTCOMMANDINFOURIOUTPUT
PT_SUCCESS
PT_FAILUREr   r   r   r7   r7   \   sA        ==-	#*'	
$	#&****r   r7   )r   
__future__r   r   r   enumobjectr   r    Enumr1   r7   r   r   r   <module>rN      s   A @ & & & & & &       ' ' ' ' ' '     V   :       <' ' ' ' ' ' ' '
 
 
 
 

 
 
 
 
 
r   