
                            d 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 ddl	m
Z
 ddl	mZ  G d	 d
e      Z eej                  j                   ej                   d      ej                  j"                   ej                   d      ej                  j$                   ej                   d      ej                  j&                   ej                   d      ej                  j(                   ej                   d      ej                  j*                   ej                   d      ej                  j,                   ej                   d      ej                  j.                   ej                   d      ej                  j0                   ej                   d      i	      Z eej                  j                   ej                   de
j4                  j6                  g       ej                  j"                   ej                   de
j4                  j6                  g       ej                  j$                   ej                   de
j4                  j8                  e
j:                  j<                  g      ej                  j&                   ej                   ddg       ej                  j(                   ej                   dde
j:                  j>                  g      ej                  j*                   ej                   de
j4                  j@                  g       ej                  j,                   ej                   de
j4                  jB                  g       ej                  j.                   ej                   de
j4                  j@                        ej                  j0                   ej                   de
j4                  jD                        i	      Z# eej                  j                   ej                   de
j4                  jH                  g       ej                  j"                   ej                   de
j4                  jH                  g       ej                  j$                   ej                   de
j4                  jJ                  e
j:                  j<                  g      ej                  j&                   ej                   ddg       ej                  j(                   ej                   dde
j:                  j>                  g      ej                  j*                   ej                   de
j4                  jL                  g       ej                  j,                   ej                   de
j4                  jN                  g       ej                  j.                   ej                   de
j4                  j@                        ej                  j0                   ej                   de
j4                  jD                        i	      Z( e e)ej                  j                  ej                  j"                  ej                  j$                  ej                  j&                  ej                  j(                  ej                  j*                  ej                  j,                  ej                  j.                  ej                  j0                  f	D  cg c].  } | ej!                  djU                  | jV                              f0 c}             Z,ddZ-yc c} w )zEMappings from TextTypes to TextAttributes used by the TextTypeParser.    )absolute_import)division)unicode_literals)
properties)console_attr)ansi)textc                       e Zd ZdZd Zd Zy)StyleMappingz'Mapping of TextTypes to TextAttributes.c                     || _         y)zCreates a StyleMapping object to be used by a StyledLogger.

    Args:
      mappings: (dict[TextTypes, TextAttributes]), the mapping
        to be used for this StyleMapping object.
    Nmappings)selfr   s     1lib/googlecloudsdk/core/console/style/mappings.py__init__zStyleMapping.__init__   s     DM    c                 >    || j                   v r| j                   |   S y Nr   )r   keys     r   __getitem__zStyleMapping.__getitem__'   s     
dmm]]3r   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    /r   r   z[{}]z{})colorattrsN)r   z
[{{}}]({})c                    | xs t        j                         } t        j                  j                  j
                  j                         }t        j                  j                  j                  j                         dk(  rt        S |s`| j                         rPt        j                  j                  j                  j                         dk7  r| j                  dk(  rt        S t        S t        S )zAGets the style mappings based on the console and user properties.testingoffzxterm-256color)r   GetConsoleAttrr   VALUESaccessibilityscreen_readerGetBoolcorecolor_themeGetSTYLE_MAPPINGS_TESTINGSupportsAnsi_termSTYLE_MAPPINGS_ANSI_256STYLE_MAPPINGS_ANSISTYLE_MAPPINGS_BASIC)console_attributesis_screen_readers     r   GetStyleMappingsr1      s    )J\-H-H-J&&44BBJJL''++-:!!'')**..0E9#33$$  r   r   ).r   
__future__r   r   r   googlecloudsdk.corer   googlecloudsdk.core.consoler   !googlecloudsdk.core.console.styler   r	   objectr   	TextTypesRESOURCE_NAMETextAttributesOUTPUT
USER_INPUTURIURLCOMMANDINFO
PT_SUCCESS
PT_FAILUREr.   ColorsBLUECYANAttrsBOLD	UNDERLINEGREENYELLOWREDr-   COLOR_33COLOR_81COLOR_34	COLOR_167r,   dictformatnamer)   r1   )	text_types   0r   <module>rS      s   L &  ' * 4 2 26 $ $NN  "5$"5"5f"=NN.4..t4NN2t2248NN+++D1NN+++D1NN/D//5NN,,,T2NN2t2248NN2t2248
% 
  #NN  "5$"5"5kk# 	NN.4..kk 	NN2t22kkzz ! 	NN+++ 	NN+++zz##$& 	NN/D//kk 	NN,,,kk   	NN2t22DKK%% 'NN2t22DKKOO %?!$ ! H 'NN  "5$"5"5kk""# 	NN.4..kk"" 	NN2t22kk""zz ! 	NN+++ 	NN+++zz##$& 	NN/D//kk"" 	NN,,,kk## 	NN2t22DKK%% 'NN2t22DKKOO %?!( ! H &d 	$$!!!!!!	#,$	#	 ##L$7$7	$GHI	#,$ '% &  ,$s   53[8