
    hh
                         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y)z:Semantic text objects that are used for styled outputting.    )absolute_import)division)unicode_literalsNc                   H    e Zd ZdZddZed        Zed        Zed        Zy)TextAttributesz%Attributes to use to style text with.Nc                 6    || _         || _        |xs g | _        y)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       O/var/www/html/dev/engine/venv/lib/python3.12/site-packages/fire/console/text.py__init__zTextAttributes.__init__   s     "DDK+2DK    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      sF    -      r   r   c                   *    e Zd ZdZddZd Zd Zd Zy)	TypedTextz8Text with a semantic type that will be used for styling.Nc                      || _         || _        y)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DNr   c                 H    d}| j                   D ]  }|t        |      z  } |S )Nr   )r"   len)r   lengthtexts      r   __len__zTypedText.__len__D   s-    F

 D	f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y)
_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$Z&&r   N)r   r   r   r   r5   r   r   r   r1   r1   S   s
    >'r   r1   c                   4    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)	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   \   s2    =-	#*'	
$	#&**r   r7   )r   
__future__r   r   r   enumobjectr   r    Enumr1   r7   r   r   r   <module>rN      sK    A &  ' V : <' '

 
r   