
    
                         S r SSKJr  SSKJr  SSKJr  SSKr " S S\5      r " S S	\5      r " S
 S\R                  5      r
 " S S\
5      rg)z:Semantic text objects that are used for styled outputting.    )absolute_import)division)unicode_literalsNc                   R    \ rS rSrSrS	S jr\S 5       r\S 5       r\S 5       r	Sr
g)
TextAttributes   z%Attributes to use to style text with.Nc                 <    Xl         X l        U=(       d    / U l        g)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       -lib/googlecloudsdk/core/console/style/text.py__init__TextAttributes.__init__   s     "K+2DK    c                     U R                   $ N)r
   r   s    r   r   TextAttributes.format_str(   s    r   c                     U R                   $ r   )r   r   s    r   r   TextAttributes.color,       ;;r   c                     U R                   $ r   )r   r   s    r   r   TextAttributes.attrs0   r   r   )r   r   r
   )NNN)__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r   __static_attributes__ r   r   r   r      sF    -      r   r   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
	TypedText5   z8Text with a semantic type that will be used for styling.Nc                     Xl         X l        g)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   TypedText.__init__8   s     JNr   c                 L    SnU R                    H  nU[        U5      -  nM     U$ )Nr   )r*   len)r   lengthtexts      r   __len__TypedText.__len__D   s(    F

D	f Mr   c                     X/n[        U5      $ r   r'   r   otherr*   s      r   __add__TypedText.__add__J   s    MEUr   c                     X/n[        U5      $ r   r4   r5   s      r   __radd__TypedText.__radd__N   s    MEUr   )r+   r*   r   )
r   r   r    r!   r"   r   r1   r7   r:   r$   r%   r   r   r'   r'   5   s    @
r   r'   c                       \ rS rSrSrS rSrg)
_TextTypesS   z6Text types base class that defines base functionality.c                 ,    [        [        U5      U 5      $ )z,Returns a TypedText object using this style.)r'   list)r   argss     r   __call___TextTypes.__call__V   s    T$Z&&r   r%   N)r   r   r    r!   r"   rB   r$   r%   r   r   r=   r=   S   s
    >'r   r=   c                   <    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrg)	TextTypes[   z5Defines text types that can be used for styling text.                        	   r%   N)r   r   r    r!   r"   RESOURCE_NAMEURL
USER_INPUTCOMMANDINFOURIOUTPUT
PT_SUCCESS
PT_FAILUREr$   r%   r   r   rE   rE   [   s2    =-	#*'	
$	#&**r   rE   )r"   
__future__r   r   r   enumobjectr   r'   Enumr=   rE   r%   r   r   <module>r]      sK    A &  ' V : <' '

 
r   