
                             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	 Zd
eiZ G d dej                        Zy)z:The command to list installed/available gcloud components.    )absolute_import)division)unicode_literals)base)log)	snapshots)update_managerc                     	 t         j                  j                  | d      }|j                  j	                         S # t
        t        t         j                  f$ r Y yw xY w)Nzcomponents.repositories.list)command_pathUnknown)r   ComponentSnapshotFromURLssdk_definitionLastUpdatedStringAttributeError	TypeErrorURLFetchError)rsnapshots     +lib/surface/components/repositories/list.pyTransformLastUpdater      s\    **33	6 4 8H""4466
)Y%<%<	= s   := AAlast_updatec                   6    e Zd ZdZdddZed        Zd Zd Zy)	ListzFList any Trusted Tester component repositories you have registered.
  aU  
          List all Trusted Tester component repositories that are registered
          with the component manager.  If you have additional repositories, the
          component manager will look at them to discover additional components
          to install, or different versions of existing components that are
          available.
      z
          To list all Trusted Tester component repositories that are registered
          with the component manager, run:

            $ {command}
      )DESCRIPTIONEXAMPLESc                     t         j                  j                  |        t         j                  j                  |        | j                  j                  d       | j                  j                  t               y)z#Adds/removes args for this command.zn
          table(
            .:label=REPOSITORY,
            last_update():label=LAST_UPDATE
          )
    N)r   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGdisplay_info	AddFormatAddTransforms#_COMPONENTS_REPOSITORIES_TRANSFORMS)parsers    r   Argsz	List.Args=   sZ     	((0MM""6*
!! # 	 %%&IJ    c                 J    t         j                  j                         }|r|S g S )zRuns the list command.)r	   UpdateManagerGetAdditionalRepositories)selfargsreposs      r   RunzList.RunJ   s#    ((BBDE5!r!r'   c                 H    |s t         j                  j                  d       y y )NzmYou have no registered component repositories.  To add one, run:
  $ gcloud components repositories add URL

)r   statuswrite)r+   resources_were_displayeds     r   EpilogzList.EpilogO   s!    #	jj;< $r'   N)	__name__
__module____qualname____doc__detailed_helpstaticmethodr&   r.   r3    r'   r   r   r   *   s8    

-  
K 
K"
<r'   r   N)r7   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   googlecloudsdk.core.updaterr   r	   r   r$   ListCommandr   r:   r'   r   <module>r@      sG     A &  ' ( # 1 6 &' #
)<4 )<r'   