
                             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 dd	lZ G d
 dej                        Zy	)z$Command to list named configuration.    )absolute_import)division)unicode_literals)base)
properties)named_configs)properties_fileNc                   0    e Zd ZdZdddZed        Zd Zy)Listz$Lists existing named configurations.z          {description}

          Run `$ gcloud topic configurations` for an overview of named
          configurations.
          zX          To list all available configurations, run:

            $ {command}
          )DESCRIPTIONEXAMPLESc                 Z   t         j                  j                  |        t         j                  j                  |        t        j
                  j                         }d}t        t        j                  |            D ]  \  }}t        j                  j                  ddt        j                  |j                  g            }|d   j!                  d      }|s]|t        j                  j"                  j$                  j&                  k7  sd} n | j(                  j+                  |       y )Nztable(
        name,
        is_active,
        properties.core.account,
        properties.core.project,
        properties.compute.zone:label=COMPUTE_DEFAULT_ZONE,
        properties.compute.region:label=COMPUTE_DEFAULT_REGION)
    T)
list_unsetinclude_hiddenr	   coreuniverse_domaina#  table(
          name,
          is_active,
          properties.core.account,
          properties.core.project,
          properties.core.universe_domain,
          properties.compute.zone:label=COMPUTE_DEFAULT_ZONE,
          properties.compute.region:label=COMPUTE_DEFAULT_REGION)
      )r   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGr   ConfigurationStore
AllConfigssortedsix	iteritemsr   VALUES	AllValuesr	   PropertiesFile	file_pathgetr   r   defaultdisplay_info	AddFormat)parserconfigstable_format_configpropsconfig_universes          )lib/surface/config/configurations/list.pyArgsz	List.Args/   s    ((0MM""6*..99;GL CMM'23	6)))88&:J:J9KL * e
 f))*;<o
!2!2!7!7!G!G!O!OO
 	) 4* !!,/    c              #   L  K   t         j                  j                         }t        t	        j
                  |            D ]a  \  }}t        j                  j                  dt        j                  |j                  g      d      }|j                  |j                  |d c y w)NT)r   r	   only_file_contents)name	is_activer   )r   r   r   r   r   r   r   r   r   r	   r   r   r/   r0   )selfargsr$   r&   r'   r(   s         r*   RunzList.RunS   s     ..99;GCMM'23	6)))88&:J:J9KL! * #e
 ++''  4s   B"B$N)__name__
__module____qualname____doc__detailed_helpstaticmethodr+   r3    r,   r*   r   r      s0    ,- !0 !0Fr,   r   )r7   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   "googlecloudsdk.core.configurationsr   r	   r   ListCommandr   r:   r,   r*   <module>r@      s6     + &  ' ( * < > 
@4 @r,   